Message321420
> I expected it should be easy to reproduce a crash, but I failed to find an example.
I don't understand how parsetok.c is supposed to handle "from __future__ import barry_as_FLUFL":
* Parser/parsetok.c tests (ps->p_flags & CO_FUTURE_BARRY_AS_BDFL)
* Python/future.c uses "if (strcmp(feature, FUTURE_BARRY_AS_BDFL) == 0) { ff->ff_features |= CO_FUTURE_BARRY_AS_BDFL; }"
* Python/pythonrun.c: PARSER_FLAGS() copies CO_FUTURE_BARRY_AS_BDFL flag as PyPARSE_BARRY_AS_BDFL
The only way to use "<>" operator seems to pass explicitly CO_FUTURE_BARRY_AS_BDFL flag to compile() flags, which is not the convenient way to use "from __future__ import barry_as_FLUFL" :-(
Code:
---
import inspect
CO_FUTURE_BARRY_AS_BDFL = 0x40000
flags = CO_FUTURE_BARRY_AS_BDFL
code = "print(1 <> 2)"
try:
compile(code, "filename", "exec", flags=0)
except SyntaxError:
print("ok")
else:
raise Exception("SyntaxError expected")
compile(code, "filename", "exec", flags=flags)
print("ok")
---
Maybe we need a test for the easter egg. Or maybe we should remove it? :-p |
|
Date |
User |
Action |
Args |
2018-07-11 09:33:45 | vstinner | set | recipients:
+ vstinner, barry, serhiy.storchaka, xiang.zhang |
2018-07-11 09:33:45 | vstinner | set | messageid: <1531301625.0.0.56676864532.issue34084@psf.upfronthosting.co.za> |
2018-07-11 09:33:44 | vstinner | link | issue34084 messages |
2018-07-11 09:33:44 | vstinner | create | |
|