Message276785
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. |
|
Date |
User |
Action |
Args |
2016-09-17 12:06:17 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, rhettinger, eric.smith, ned.deily, r.david.murray, martin.panter, serhiy.storchaka, yselivanov, Tim.Graham, yan12125, abarry |
2016-09-17 12:06:16 | ncoghlan | set | messageid: <1474113976.99.0.477329835242.issue28128@psf.upfronthosting.co.za> |
2016-09-17 12:06:16 | ncoghlan | link | issue28128 messages |
2016-09-17 12:06:16 | ncoghlan | create | |
|