Message150125
| Author |
marco |
| Recipients |
marco |
| Date |
2011年12月23日.01:23:30 |
| SpamBayes Score |
7.0341457e-07 |
| Marked as misclassified |
No |
| Message-id |
<1324603413.15.0.70120207617.issue13654@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Writing the following code in the IDLE module/scriptneditor and then running it (F5) will momentarily freeze without giving the expected warning message ("SyntaxWarning: name 'GLOBAL1' is used prior to global declaration") and it will crash all IDLE windows instances if ran multiple times after it.
------------------
start code snippet:
------------------
GLOBAL1=10
def test_chnge_val_1(a=1):
## global GLOBAL1
b=GLOBAL1
print GLOBAL1, b
global GLOBAL1
GLOBAL1 += a
b= 100
print GLOBAL1, b
if __name__ == '__main__':
test_chnge_val_1()
----------------
end code snippet:
----------------
The desired behavior is to not crash but run the code with output and shoot the expected message to STOUT/shell console like regular python shell would.
-----
Notes:
-----
issue_global_crash.py code-file attached. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2011年12月23日 01:23:33 | marco | set | recipients:
+ marco |
| 2011年12月23日 01:23:33 | marco | set | messageid: <1324603413.15.0.70120207617.issue13654@psf.upfronthosting.co.za> |
| 2011年12月23日 01:23:32 | marco | link | issue13654 messages |
| 2011年12月23日 01:23:30 | marco | create |
|