diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2014-10-09 19:32:12 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2014-10-09 19:32:12 +0200 |
commit | e701004a33f3b7257066a877290a411fac0ffce5 (patch) | |
tree | f4231d869ef0ef036248099cac0b96f4ce0b93ad | |
parent | f5549cbd07be9d8bbbc0851957376d34d9e19e85 (diff) | |
download | cython-e701004a33f3b7257066a877290a411fac0ffce5.tar.gz |
minor code cleanup
--HG--
extra : transplant_source : %C6f%B9L%06%0A%97m%15K%F7%CCN%90%B0%A5%90%04%96%A9
-rw-r--r-- | Cython/Build/Dependencies.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py index b130e03ff..3c102d407 100644 --- a/Cython/Build/Dependencies.py +++ b/Cython/Build/Dependencies.py @@ -251,6 +251,7 @@ def strip_string_literals(code, prefix='__Pyx_L'): in_quote = False hash_mark = single_q = double_q = -1 code_len = len(code) + quote_type = None while True: if hash_mark < q: @@ -260,7 +261,8 @@ def strip_string_literals(code, prefix='__Pyx_L'): if double_q < q: double_q = code.find('"', q) q = min(single_q, double_q) - if q == -1: q = max(single_q, double_q) + if q == -1: + q = max(single_q, double_q) # We're done. if q == -1 and hash_mark == -1: @@ -276,7 +278,8 @@ def strip_string_literals(code, prefix='__Pyx_L'): if k % 2 == 0: q += 1 continue - if code[q] == quote_type and (quote_len == 1 or (code_len > q + 2 and quote_type == code[q+1] == code[q+2])): + if code[q] == quote_type and ( + quote_len == 1 or (code_len > q + 2 and quote_type == code[q+1] == code[q+2])): counter += 1 label = "%s%s_" % (prefix, counter) literals[label] = code[start+quote_len:q] |