Skip to content

Commit

Permalink
Remove unicode symbols from source code (Python 2.7 is not support th…
Browse files Browse the repository at this point in the history
…at and throw exception on import of this file)
  • Loading branch information
alexprey committed Jul 10, 2018
1 parent bd42d1d commit f09c9bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pysd/py_backend/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ def make_python_identifier(string, namespace=None, reserved_words=None,

if convert == 'hex':
# Convert invalid characters to hex. Note: \p{l} designates all Unicode letter characters (any language),
# \p{m} designates all mark symbols (e.g., vowel marks in Indian scrips, such as the final ે in નમસ્તે)
# \p{m} designates all mark symbols (e.g., vowel marks in Indian scrips, such as the final)
# and \p{n} designates all numbers. We allow any of these to be present in the regex.
s = ''.join([c.encode("hex") if re.findall('[^\p{l}\p{m}\p{n}_]', c) else c for c in s])

Expand Down

0 comments on commit f09c9bd

Please sign in to comment.