Author: Brian Kearns <[email protected]>
Branch: stdlib-2.7.6
Changeset: r69662:df7577100226
Date: 2014-03-04 02:44 -0500
http://bitbucket.org/pypy/pypy/changeset/df7577100226/

Log:    update _testcapi module, re-enable in test_codecs.py

diff --git a/lib-python/2.7/test/test_codecs.py 
b/lib-python/2.7/test/test_codecs.py
--- a/lib-python/2.7/test/test_codecs.py
+++ b/lib-python/2.7/test/test_codecs.py
@@ -2,11 +2,7 @@
 import unittest
 import codecs
 import locale
-import sys, StringIO
-try:
-    import _testcapi
-except ImportError:
-    _testcapi = None
+import sys, StringIO, _testcapi
 
 def coding_checker(self, coder):
     def check(input, expect):
@@ -1529,7 +1525,7 @@
                     decodedresult += reader.read()
                 self.assertEqual(decodedresult, s, "%r != %r (encoding=%r)" % 
(decodedresult, s, encoding))
 
-            if encoding not in broken_incremental_coders and _testcapi:
+            if encoding not in broken_incremental_coders:
                 # check incremental decoder/encoder (fetched via the Python
                 # and C API) and iterencode()/iterdecode()
                 try:
diff --git a/lib_pypy/_testcapimodule.c b/lib_pypy/_testcapimodule.c
--- a/lib_pypy/_testcapimodule.c
+++ b/lib_pypy/_testcapimodule.c
@@ -1119,7 +1119,7 @@
     if (!PyArg_ParseTuple(args, "u#|s", &unicode, &length, &errors))
         return NULL;
 
-    decimal_length = length * 7; /* len('&#8364;') */
+    decimal_length = length * 10; /* len('&#1114111;') */
     decimal = PyBytes_FromStringAndSize(NULL, decimal_length);
     if (decimal == NULL)
         return NULL;
@@ -1814,7 +1814,7 @@
         ;
     test_structmembers *ob;
     const char *s = NULL;
-    Py_ssize_t string_len = 0;
+    int string_len = 0;
     ob = PyObject_New(test_structmembers, type);
     if (ob == NULL)
         return NULL;
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to