Commits

Armin Rigo committed a6dcef2

Bah. Try to fix translation on non-OSX platforms.

Comments (0)

Files changed (2)

pypy/module/mmap/interp_mmap.py

 from pypy.interpreter.typedef import TypeDef
 from pypy.interpreter.gateway import interp2app, unwrap_spec, NoneNotWrapped
 from pypy.rlib import rmmap
-from pypy.rlib.rmmap import RValueError, RTypeError, ROverflowError, RSystemError
+from pypy.rlib.rmmap import RValueError, RTypeError, ROverflowError
 import sys
 import os
 import platform
             self.mmap.resize(newsize)
         except OSError, e:
             raise mmap_error(self.space, e)
-        except RSystemError, e:
+        except RValueError, e:
+            # obscure: in this case, RValueError translates to an app-level
+            # SystemError.
             raise OperationError(self.space.w_SystemError,
                                  self.space.wrap(e.message))
 

pypy/rlib/rmmap.py

     def __init__(self, message):
         self.message = message
 
-class RSystemError(Exception):
-    def __init__(self, message):
-        self.message = message
-
 includes = ["sys/types.h"]
 if _POSIX:
     includes += ['unistd.h', 'sys/mman.h']
         
         if _POSIX:
             if not has_mremap:
-                raise RSystemError("mmap: resizing not available--no mremap()")
+                raise RValueError("mmap: resizing not available--no mremap()")
             
             # resize the underlying file first
             os.ftruncate(self.fd, self.offset + newsize)