using is_stringish().

* bytes almost never come up except reading hash signature files.

Change-Id: I04bcfe2af016e0f29fd76cafceda72f51b9abe18
(cherry picked from commit ef74f535c2f74f30ddd7a588486253bced2a3e32)
This commit is contained in:
Mark Charney
2017-06-12 09:57:33 -04:00
parent 8fd2fe0236
commit f5cc39cfe1
2 changed files with 3 additions and 3 deletions

View File

@@ -148,7 +148,7 @@ class operand_info_t(object):
if ( len(self.bits) == 1 and
operand_info_t.decimal_number_pattern.match(self.bits[0]) ):
return True
elif type(self.bits) == bytes:
elif genutil.is_stirngish(self.bits):
if operand_info_t.decimal_number_pattern.match(self.bits):
return True
return False

View File

@@ -548,7 +548,7 @@ class conditions_t(object):
return False
def and_cond(self, c):
if type(c) in [str,bytes]:
if is_stringish(c):
nc = condition_t(c)
else:
nc = c
@@ -694,7 +694,7 @@ class rule_t(object):
self.actions = []
for action in action_list:
if type(action) in [str,bytes]:
if is_stringish(action):
self.actions.append(actions.action_t(action))
else:
self.actions.append(action)