Skip to content

Commit

Permalink
compytibility for python3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Riolo committed Apr 15, 2015
1 parent 9ee6e87 commit 0ea0bd2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/martian/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ def not_unicode_or_ascii(value):
return True
return is_not_ascii(value)

is_not_ascii = re.compile(eval(r'u"[\u0080-\uffff]"')).search

# extra compatibility for python3.2
if sys.version_info<(3,)
is_not_ascii = re.compile(eval(r'u"[\u0080-\uffff]"')).search
else:
is_not_ascii = re.compile(eval(r'"[\u0080-\uffff]"')).search


def isclass(obj):
"""We cannot use ``inspect.isclass`` because it will return True
Expand Down

0 comments on commit 0ea0bd2

Please sign in to comment.