Author: Philip Jenvey <[email protected]>
Branch:
Changeset: r64807:e258a99e3784
Date: 2013-06-05 14:46 -0700
http://bitbucket.org/pypy/pypy/changeset/e258a99e3784/
Log: have recursive Cache build failures trigger a more specific
RuntimeError
diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -917,7 +917,8 @@
try:
optimize = space.sys.get_flag('optimize')
- except Exception:
+ except RuntimeError:
+ # during bootstrapping
optimize = 0
if optimize >= 2:
code_w.remove_docstrings(space)
@@ -1018,7 +1019,8 @@
code_w = read_compiled_module(space, cpathname, source)
try:
optimize = space.sys.get_flag('optimize')
- except Exception:
+ except RuntimeError:
+ # during bootstrapping
optimize = 0
if optimize >= 2:
code_w.remove_docstrings(space)
diff --git a/rpython/rlib/cache.py b/rpython/rlib/cache.py
--- a/rpython/rlib/cache.py
+++ b/rpython/rlib/cache.py
@@ -44,8 +44,8 @@
return self.content[key]
except KeyError:
if key in self._building:
- raise Exception, "%s recursive building of %r" % (
- self, key)
+ raise RuntimeError("%s recursive building of %r" %
+ (self, key))
self._building[key] = True
try:
result = self._build(key)
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit