Issue 1090482: Patch for bug 999042. (original) (raw)

Issue1090482

Created on 2004-12-23 18:07 by dsuch, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
pycodegen.patch dsuch,2004-12-23 18:08 Patch to make compiler module handle global statement correctly.
Messages (2)
msg47404 - (view) Author: Dariusz Suchojad (dsuch) Date: 2004-12-23 18:07
Hello, I believe this one-line patch fixes [999042] "Compiler module doesn't handle global statement correctly" bug. Without setting the 'optimized' flag compiler.pycodegen.CodeGenerator._nameOp always emits STORE_NAME and not STORE_GLOBAL opcode. After applying test_compiler passes fine.
msg47405 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2006-12-11 04:48
This patch is wrong. STORE_GLOBAL ought to be used even if optimization is turned off; faking it to be True may have undesirable side effects. The builtin compiler solves this problem by putting the GLOBAL_EXPLICIT scope to a name. The compiler package should do the same. Rejecting this patch.
History
Date User Action Args
2022-04-11 14:56:08 admin set github: 41364
2004-12-23 18:07:56 dsuch create