This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mbussonn
Recipients mbussonn
Date 2020-08-10.21:57:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-08-10 21:57:55mbussonnsetrecipients: + mbussonn
2020-08-10 21:57:55mbussonnsetmessageid: <1597096675.93.0.560814112421.issue41520@roundup.psfhosted.org>
2020-08-10 21:57:55mbussonnlinkissue41520 messages
2020-08-10 21:57:55mbussonncreate