summaryrefslogtreecommitdiff
path: root/numpy/lib/format.py
diff options
context:
space:
mode:
authorDennis Weyland <dennisweyland@gmail.com>2018-02-05 03:29:18 +0100
committerDennis Weyland <dennisweyland@gmail.com>2018-02-05 06:04:50 +0100
commit8d5bdd145f622aa948026259b1a9e362d44306b2 (patch)
tree08959bb589a41850dc975792e1eabaa9e29fc00f /numpy/lib/format.py
parent81c4b5ae13540655c3faeadc645fc1dfbe9ffe82 (diff)
downloadnumpy-8d5bdd145f622aa948026259b1a9e362d44306b2.tar.gz
minor fix for python3 compatibility
Diffstat (limited to 'numpy/lib/format.py')
-rw-r--r--numpy/lib/format.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/format.py b/numpy/lib/format.py
index 89a8cb42f..363bb2101 100644
--- a/numpy/lib/format.py
+++ b/numpy/lib/format.py
@@ -455,8 +455,8 @@ def _filter_header(s):
tokens = []
last_token_was_number = False
# adding newline as python 2.7.5 workaround
- s += "\n"
- for token in tokenize.generate_tokens(StringIO(asstr(s)).readline):
+ string = asstr(s) + "\n"
+ for token in tokenize.generate_tokens(StringIO(string).readline):
token_type = token[0]
token_string = token[1]
if (last_token_was_number and