Commits

Anonymous committed b9edcf7 Draft

Reraise exceptions from original frame

Comments (0)

Files changed (1)

anyjson/__init__.py

         try:
             return self._encode(data)
         except self._encode_error, exc:
-            raise TypeError(*exc.args)
+            raise TypeError, TypeError(*exc.args), sys.exc_info()[2]
     serialize = dumps
 
     def loads(self, s):
                 return self._filedecode(StringIO(s))
             return self._decode(s)
         except self._decode_error, exc:
-            raise ValueError(*exc.args)
+            raise ValueError, ValueError(*exc.args), sys.exc_info()[2]
     deserialize = loads