You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While looking into the implications of #284 I found that bpython differs in behavior from python when a file test.py contains
from __future__ import division
and I run (b)python -i test.py and then enter 1/2.
I'm not sure how to go about fixing this - if interpreter.runsource (our current technique) doesn't work, I'm not sure what would - maybe we should be ast inspecting test.py for future statements?
The text was updated successfully, but these errors were encountered:
The problem is that bpython.args.exec_code uses the built-in compile function instead of using the interpreter object's compile method. The compile method on interpreter objects is an instance of codeop.CommandCompiler, which remembers what __future__ imports it has already seen.
This looks good to me! We should stop skipping bpython.test.test_curtsies_repl.TestFutureImports.test_interactive if this is merged, this makes it pass.
While looking into the implications of #284 I found that bpython differs in behavior from python when a file test.py contains
and I run (b)python -i test.py and then enter 1/2.
I'm not sure how to go about fixing this - if interpreter.runsource (our current technique) doesn't work, I'm not sure what would - maybe we should be ast inspecting test.py for future statements?
The text was updated successfully, but these errors were encountered: