summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorHarel Ben-Attia <harelba@gmail.com>2014-06-14 08:26:06 -0400
committerHarel Ben-Attia <harelba@gmail.com>2014-06-14 08:26:06 -0400
commit705a6d17667492d9d79430ca1b69cc50c750579c (patch)
treefc055cc06bad7ea927479d679784d8de3eaf9e1a /bin
parent6225144e7670e7e502ff2eb0d2dd0170db780127 (diff)
Added fix for regexp handling of null and non string data
Diffstat (limited to 'bin')
-rwxr-xr-xbin/q7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/q b/bin/q
index e06a614..ab83146 100755
--- a/bin/q
+++ b/bin/q
@@ -165,7 +165,12 @@ parser.add_option_group(query_option_group)
#-----------------------------------------------
def regexp(regular_expression, data):
- return re.search(regular_expression, data) is not None
+ if data is not None:
+ if type(data) is not str:
+ data = str(data)
+ return re.search(regular_expression, data) is not None
+ else:
+ return False
class Sqlite3DBResults(object):
def __init__(self,query_column_names,results):