Message375152
assuming
$ cat foo.py
import warnings
from codeop import compile_command
warnings.simplefilter('error', SyntaxWarning)
res = compile_command('1 is 1\n', symbol='exec')
print('Res', res)
On 3.8.0...3.8.4 this correctly raises a SyntaxError:
python foo.py
Traceback (most recent call last):
File "foo.py", line 5, in <module>
res = compile_command('1 is 1\n', symbol='exec')
File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 122, in compile_command
return _maybe_compile(_compile, source, filename, symbol)
File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 99, in _maybe_compile
raise err1
File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 87, in _maybe_compile
code1 = compiler(source + "\n", filename, symbol)
File "/Users/bussonniermatthias/miniconda3/envs/38/lib/python3.8/codeop.py", line 102, in _compile
return compile(source, filename, symbol, PyCF_DONT_IMPLY_DEDENT)
File "<input>", line 1
SyntaxError: "is" with a literal. Did you mean "=="?
But will silently return None on 3.8.5
$ python foo.py
Res None |
|
Date |
User |
Action |
Args |
2020-08-10 21:57:55 | mbussonn | set | recipients:
+ mbussonn |
2020-08-10 21:57:55 | mbussonn | set | messageid: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org> |
2020-08-10 21:57:55 | mbussonn | link | issue41520 messages |
2020-08-10 21:57:55 | mbussonn | create | |
|