[pypy-svn] r45832 - pypy/branch/pypy-more-rtti-inprogress/translator/sandbox

arigo at codespeak.net arigo at codespeak.net
Fri Aug 17 20:29:36 CEST 2007


Author: arigo
Date: Fri Aug 17 20:29:35 2007
New Revision: 45832

Modified:
   pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/sandlib.py
Log:
Seems better to report a regular OSError for vpaths we don't know about.
It allows e.g. 'import random' to succeed - otherwise it crashes trying
to open '/dev/urandom'.


Modified: pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/sandlib.py
==============================================================================
--- pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/sandlib.py	(original)
+++ pypy/branch/pypy-more-rtti-inprogress/translator/sandbox/sandlib.py	Fri Aug 17 20:29:35 2007
@@ -239,7 +239,7 @@
             if test in self.path_mapping:
                 break    # found
         else:
-            raise VirtualOSError("no access to vpath %r" % (vpath,))
+            raise OSError(errno.ENOENT, "no access to vpath %r" % (vpath,))
         result = self.path_mapping[test]
         if i < len(components):
             # forbid escapes via '..'



More information about the Pypy-commit mailing list