Nick Coghlan added the comment:
Eric's basic approach sounds fine to me.
The "pre-compiled .pyc files won't trigger SyntaxWarning" problem isn't new, as
it exists for the old 3.5 warnings as well (-B prevents writing bytecode, which
may be handy while working on this. Unfortunately, there's no equivalent to
prevent reading it except deleting the offending bytecode file):
$ python3 -B -c "import syntax_warning"
/home/ncoghlan/devel/py36/syntax_warning.py:3: SyntaxWarning: name 'x' is
assigned to before global declaration
global x
$ python3 -c "import syntax_warning"
/home/ncoghlan/devel/py36/syntax_warning.py:3: SyntaxWarning: name 'x' is
assigned to before global declaration
global x
$ python3 -c "import syntax_warning"
$ rm __pycache__/syntax_warning.cpython-35.pyc
$ python3 -B -c "import syntax_warning"
/home/ncoghlan/devel/py36/syntax_warning.py:3: SyntaxWarning: name 'x' is
assigned to before global declaration
global x
As long as folks are running their tests at least once in fresh environments
they'll see the warning.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28128>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com