Commit dc9a9649 authored by Stefan Behnel's avatar Stefan Behnel

Make IPythonMagic switch to language_level=2 on Py2, now that we default to "3str".

parent 21ae965c
...@@ -419,12 +419,11 @@ class CythonMagics(Magics): ...@@ -419,12 +419,11 @@ class CythonMagics(Magics):
quiet=quiet, quiet=quiet,
annotate=args.annotate, annotate=args.annotate,
force=True, force=True,
language_level=min(3, sys.version_info[0]),
) )
if args.language_level is not None: if args.language_level is not None:
assert args.language_level in (2, 3) assert args.language_level in (2, 3)
opts['language_level'] = args.language_level opts['language_level'] = args.language_level
elif sys.version_info[0] >= 3:
opts['language_level'] = 3
return cythonize([extension], **opts) return cythonize([extension], **opts)
except CompileError: except CompileError:
return None return None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment