Skip to content
Browse files

signalflag test: use a simple object to hold flag value instead of an…

… array
  • Loading branch information...
1 parent 9e93dc4 commit 8d73803f2a304a435538673094433caebcc6c434 @lirazsiri lirazsiri committed Aug 10, 2011
Showing with 7 additions and 4 deletions.
  1. +7 −4 tests/signalflag.py
View
11 tests/signalflag.py
@@ -2,17 +2,20 @@
import time
import signal
-flag = [ True ]
+class Bool:
+ value = True
+
+flag = Bool()
def handler(s, f):
print "handler"
- flag[0] = False
+ flag.value = False
signal.signal(signal.SIGINT, handler)
def callback():
- print "flag: " + `flag[0]`
- return flag[0]
+ print "flag: " + `flag.value`
+ return flag.value
while True:
if not callback():

0 comments on commit 8d73803

Please sign in to comment.
Something went wrong with that request. Please try again.