Commits

David Schneider committed 55bfb1c

Move a cast to runtime, to fix translation

Comments (0)

Files changed (1)

pypy/module/_multiprocessing/interp_semaphore.py

     TIMEVALP       = rffi.CArrayPtr(TIMEVAL)
     TIMESPECP      = rffi.CArrayPtr(TIMESPEC)
     SEM_T          = rffi.COpaquePtr('sem_t', compilation_info=eci)
-    SEM_FAILED     = rffi.cast(SEM_T, config['SEM_FAILED'])
+    SEM_FAILED     = config['SEM_FAILED'] # rffi.cast(SEM_T, config['SEM_FAILED'])
     SEM_VALUE_MAX  = config['SEM_VALUE_MAX']
     SEM_TIMED_WAIT = config['SEM_TIMED_WAIT']
     HAVE_BROKEN_SEM_GETVALUE = config['SEM_GETVALUE']
 
     def sem_open(name, oflag, mode, value):
         res = _sem_open(name, oflag, mode, value)
-        if res == SEM_FAILED:
+        if res == rffi.cast(SEM_T, SEM_FAILED):
             raise OSError(rposix.get_errno(), "sem_open failed")
         return res