# - have a 'dispatch' function as a window member
-# XXX This is UNIX specific! For the Mac we need to use a simpler version!
-
-
import stdwin, stdwinq
from stdwinevents import *
recursion_level = recursion_level + 1
try:
stdwin_select_handler() # Process events already in queue
- fd = stdwin.fileno()
while 1:
- if windows:
+ if windows and not fdlist:
+ while windows and not fdlist:
+ try:
+ event = stdwinq.getevent()
+ except KeyboardInterrupt:
+ event = (WE_COMMAND, \
+ None, WC_CANCEL)
+ dispatch(event)
+ elif windows and fdlist:
+ fd = stdwin.fileno()
if recursion_level == 1:
registerfd(fd, 'r', stdwin_select_handler)
try:
# - have a 'dispatch' function as a window member
-# XXX This is UNIX specific! For the Mac we need to use a simpler version!
-
-
import stdwin, stdwinq
from stdwinevents import *
recursion_level = recursion_level + 1
try:
stdwin_select_handler() # Process events already in queue
- fd = stdwin.fileno()
while 1:
- if windows:
+ if windows and not fdlist:
+ while windows and not fdlist:
+ try:
+ event = stdwinq.getevent()
+ except KeyboardInterrupt:
+ event = (WE_COMMAND, \
+ None, WC_CANCEL)
+ dispatch(event)
+ elif windows and fdlist:
+ fd = stdwin.fileno()
if recursion_level == 1:
registerfd(fd, 'r', stdwin_select_handler)
try:
else: raise TestFailed, 'long() does not round properly'
if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass
else: raise TestFailed, 'float() does not work properly'
+print '6.4.1 32-bit integers'
+if 12 + 24 <> 36: raise TestFailed, 'int op'
+if 12 + (-24) <> -12: raise TestFailed, 'int op'
+if (-12) + 24 <> 12: raise TestFailed, 'int op'
+if (-12) + (-24) <> -36: raise TestFailed, 'int op'
+if not 12 < 24: raise TestFailed, 'int op'
+if not -24 < -12: raise TestFailed, 'int op'
+print '6.4.2 Long integers'
+if 12L + 24L <> 36L: raise TestFailed, 'long op'
+if 12L + (-24L) <> -12L: raise TestFailed, 'long op'
+if (-12L) + 24L <> 12L: raise TestFailed, 'long op'
+if (-12L) + (-24L) <> -36L: raise TestFailed, 'long op'
+if not 12L < 24L: raise TestFailed, 'long op'
+if not -24L < -12L: raise TestFailed, 'long op'
+print '6.4.3 Floating point numbers'
+if 12.0 + 24.0 <> 36.0: raise TestFailed, 'float op'
+if 12.0 + (-24.0) <> -12.0: raise TestFailed, 'float op'
+if (-12.0) + 24.0 <> 12.0: raise TestFailed, 'float op'
+if (-12.0) + (-24.0) <> -36.0: raise TestFailed, 'float op'
+if not 12.0 < 24.0: raise TestFailed, 'float op'
+if not -24.0 < -12.0: raise TestFailed, 'float op'
print '6.5 Sequence types'