[pypy-svn] r33060 - pypy/dist/pypy/objspace/cclp
auc at codespeak.net
auc at codespeak.net
Mon Oct 9 16:51:53 CEST 2006
Author: auc
Date: Mon Oct 9 16:51:52 2006
New Revision: 33060
Modified:
pypy/dist/pypy/objspace/cclp/misc.py
Log:
replace global list by global instance
Modified: pypy/dist/pypy/objspace/cclp/misc.py
==============================================================================
--- pypy/dist/pypy/objspace/cclp/misc.py (original)
+++ pypy/dist/pypy/objspace/cclp/misc.py Mon Oct 9 16:51:52 2006
@@ -6,16 +6,20 @@
import os
-NO_DEBUG_INFO = [True]
+class State: pass
+
+NO_DEBUG_INFO = State()
+NO_DEBUG_INFO.state = True
+
def w(*msgs):
"""writeln"""
- if NO_DEBUG_INFO[0]: return
+ if NO_DEBUG_INFO.state: return
v(*msgs)
os.write(1, ' \n')
def v(*msgs):
"""write"""
- if NO_DEBUG_INFO[0]: return
+ if NO_DEBUG_INFO.state: return
for msg in list(msgs):
os.write(1, msg)
os.write(1, ' ')
@@ -32,7 +36,7 @@
app_interp_id = gateway.interp2app(interp_id)
def switch_debug_info(space):
- NO_DEBUG_INFO[0] = not NO_DEBUG_INFO[0]
+ NO_DEBUG_INFO.state = not NO_DEBUG_INFO.state
app_switch_debug_info = gateway.interp2app(switch_debug_info)
More information about the Pypy-commit
mailing list