[pypy-svn] r15568 - pypy/dist/pypy/lib
ale at codespeak.net
ale at codespeak.net
Wed Aug 3 18:03:44 CEST 2005
Author: ale
Date: Wed Aug 3 18:03:43 2005
New Revision: 15568
Modified:
pypy/dist/pypy/lib/_exceptions.py
Log:
Allow less strict checks on arguments to SyntaxError.
Fixes some failures like "TypeError: argument 1 must be str, not ...."
I have not been able to add this functionality to _enum_exceptions.py
Modified: pypy/dist/pypy/lib/_exceptions.py
==============================================================================
--- pypy/dist/pypy/lib/_exceptions.py (original)
+++ pypy/dist/pypy/lib/_exceptions.py Wed Aug 3 18:03:43 2005
@@ -259,11 +259,11 @@
self.filename = args[1][0]
else:
raise TypeError('argument 1 must be str, not %s'%type(args[1][0]))
- if type(args[1][1]) == int:
+ if args[1][1] is None or type(args[1][1]) == int:
self.lineno = args[1][1]
else:
raise TypeError('argument 2 must be str, not %s'%type(args[1][1]))
- if type(args[1][2]) == int:
+ if args[1][2] is None or type(args[1][2]) == int:
self.offset = args[1][2]
else:
raise TypeError('argument 3 must be str, not %s'%type(args[1][2]))
More information about the Pypy-commit
mailing list