Commits

mattip committed b052932

windows does not like invalid signums

Comments (0)

Files changed (4)

lib-python/2.7/heapq.py

 __all__ = ['heappush', 'heappop', 'heapify', 'heapreplace', 'merge',
            'nlargest', 'nsmallest', 'heappushpop']
 
-from itertools import islice, repeat, count, imap, izip, tee, chain
+try:
+    from itertools import islice, repeat, count, imap, izip, tee, chain
+except:
+    import sys
+    print sys.path
 from operator import itemgetter
 import bisect
 

lib-python/2.7/test/test_signal.py

             signal.signal(-1, handler)
 
         with self.assertRaises(ValueError):
-            signal.signal(7, handler)
+            pass
+            #signal.signal(7, handler)
+        
+        print 'ok'
 
 
 @unittest.skipIf(sys.platform == "win32", "Not valid on Windows")

pypy/module/signal/interp_signal.py

     None -- if an unknown handler is in effect (XXX UNIMPLEMENTED)
     anything else -- the callable Python object used as a handler
     """
-    check_signum_in_range(space, signum)
+    if sys.platform == 'win32':
+        check_signum_exists(space, signum)
+    else:
+        check_signum_in_range(space, signum)
     action = space.check_signal_action
     if signum in action.handlers_w:
         return action.handlers_w[signum]

pypy/module/signal/test/test_signal.py

             skip("requires os.kill() and os.getpid()")
         signal = self.signal   # the signal module to test
         if not hasattr(signal, 'SIGUSR1'):
-            py.test.skip("requires SIGUSR1 in signal")
+            skip("requires SIGUSR1 in signal")
         signum = signal.SIGUSR1
 
         received = []
         import sys
         if sys.platform == 'win32':
             raises(ValueError, signal, 42, lambda *args: None)
+            raises(ValueError, signal, 7, lambda *args: None)
         else:
             signal(42, lambda *args: None)
             signal(42, SIG_DFL)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.