Skip to content

Commit f992edf

Browse files
committed
BF: fix recursion error on Python 3.3
Python 3.3 seems to get upset with filling format string values from byte strings. See: http://nipy.bic.berkeley.edu/builders/nibabel-py3.3/builds/240/steps/shell_5/logs/stdio
1 parent a4724b7 commit f992edf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

nibabel/streamlines/trk.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -728,6 +728,10 @@ def __str__(self):
728728
vars['property_names'] = "\n ".join([asstr(s)
729729
for s in vars['property_name']
730730
if len(s) > 0])
731+
# Make all byte strings into strings
732+
# Fixes recursion error on Python 3.3
733+
vars = dict((k, asstr(v) if hasattr(v, 'decode') else v)
734+
for k, v in vars.items())
731735
return """\
732736
MAGIC NUMBER: {MAGIC_NUMBER}
733737
v.{version}

0 commit comments

Comments
 (0)