[pypy-svn] r15503 - in pypy/dist/pypy: interpreter/pyparser/test module/_codecs

ale at codespeak.net ale at codespeak.net
Tue Aug 2 12:30:15 CEST 2005


Author: ale
Date: Tue Aug  2 12:30:13 2005
New Revision: 15503

Modified:
   pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py
   pypy/dist/pypy/module/_codecs/app_codecs.py
Log:
The skipped test in test_parsestring passes. For some reason you cant ask isinstance(<a number>,(int,long)) at interpreterlevel ?

Changed the isinstance to only ask for ints.

enabled the test

Modified: pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py
==============================================================================
--- pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py	(original)
+++ pypy/dist/pypy/interpreter/pyparser/test/test_parsestring.py	Tue Aug  2 12:30:13 2005
@@ -43,7 +43,7 @@
         assert ret == eval("# -*- coding: koi8-u -*-\nu'\x81'") 
 
     def test_simple_enc_roundtrip(self):
-        py.test.skip("crashes in app_codecs, but when cheating using .encode at interp-level passes?!")
+        #py.test.skip("crashes in app_codecs, but when cheating using .encode at interp-level passes?!")
         space = self.space
         s = "'\x81'"
         s = s.decode("koi8-u").encode("utf8")

Modified: pypy/dist/pypy/module/_codecs/app_codecs.py
==============================================================================
--- pypy/dist/pypy/module/_codecs/app_codecs.py	(original)
+++ pypy/dist/pypy/module/_codecs/app_codecs.py	Tue Aug  2 12:30:13 2005
@@ -39,6 +39,7 @@
 
 """
 #from unicodecodec import *
+
 import sys
 #/* --- Registry ----------------------------------------------------------- */
 codec_search_path = []
@@ -216,6 +217,7 @@
 def charmap_encode(obj,errors='strict',mapping='latin-1'):
     """None
     """
+
     res = PyUnicode_EncodeCharmap(obj,len(obj),mapping,errors)
     res = ''.join(res)
     return res, len(res)
@@ -1468,9 +1470,8 @@
 
 def charmapencode_output(c,mapping):
 
-    
     rep = mapping[c]
-    if isinstance(rep,(int,long)):
+    if isinstance(rep,int):
         if rep<256:
             return chr(rep)
         else:



More information about the Pypy-commit mailing list