Strange compiler warning
Robin Becker
robin at jessikat.fsnet.co.uk
Mon Oct 7 13:52:43 EDT 2002
More information about the Python-list mailing list
Mon Oct 7 13:52:43 EDT 2002
- Previous message (by thread): Strange compiler warning
- Next message (by thread): Strange compiler warning
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
with 2.2.1 I get the message
SyntaxWarning: name '_dbg' is assigned to before global declaration with
the following code, but things seem to be working, so is the compiler
wrong or too lazy to see the globals on all paths? How should one do
this sort of on the fly local debugging?
......
if not globals().has_key('_dbg'):
global _dbg
_dbg=open('/tmp/_dbg.txt','w')
else:
global _dbg
print >>_dbg,'=======================\n' + text
--
Robin Becker
- Previous message (by thread): Strange compiler warning
- Next message (by thread): Strange compiler warning
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list