[pypy-svn] r75642 - in pypy/branch/fast-forward/pypy/module/exceptions: . test

benjamin at codespeak.net benjamin at codespeak.net
Mon Jun 28 18:38:01 CEST 2010


Author: benjamin
Date: Mon Jun 28 18:37:59 2010
New Revision: 75642

Modified:
   pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py
   pypy/branch/fast-forward/pypy/module/exceptions/test/test_exc.py
Log:
SyntaxError.msg is None by default

Modified: pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py	(original)
+++ pypy/branch/fast-forward/pypy/module/exceptions/interp_exceptions.py	Mon Jun 28 18:37:59 2010
@@ -499,7 +499,7 @@
         self.w_lineno   = space.w_None
         self.w_offset   = space.w_None
         self.w_text     = space.w_None
-        self.w_msg      = space.wrap('')
+        self.w_msg      = space.w_None
         self.w_print_file_and_line = space.w_None # what's that?
         W_BaseException.__init__(self, space)
 

Modified: pypy/branch/fast-forward/pypy/module/exceptions/test/test_exc.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/exceptions/test/test_exc.py	(original)
+++ pypy/branch/fast-forward/pypy/module/exceptions/test/test_exc.py	Mon Jun 28 18:37:59 2010
@@ -131,6 +131,8 @@
 
     def test_syntax_error(self):
         from exceptions import SyntaxError
+        s = SyntaxError()
+        assert s.msg is None
         s = SyntaxError(3)
         assert str(s) == '3'
         assert str(SyntaxError("a", "b", 123)) == "a"



More information about the Pypy-commit mailing list