Author: Alex Gaynor <alex.gay...@gmail.com>
Branch: 
Changeset: r44163:8eaee8a4eb60
Date: 2011-05-14 11:37 -0500
http://bitbucket.org/pypy/pypy/changeset/8eaee8a4eb60/

Log:    Merged upstream.

diff --git a/lib-python/modified-2.7/test/test_multiprocessing.py 
b/lib-python/modified-2.7/test/test_multiprocessing.py
--- a/lib-python/modified-2.7/test/test_multiprocessing.py
+++ b/lib-python/modified-2.7/test/test_multiprocessing.py
@@ -510,6 +510,7 @@
 
         p.join()
 
+    @unittest.skipIf(os.name == 'posix', "PYPY: FIXME")
     def test_qsize(self):
         q = self.Queue()
         try:
@@ -1090,6 +1091,7 @@
 class _TestPoolWorkerLifetime(BaseTestCase):
 
     ALLOWED_TYPES = ('processes', )
+    @unittest.skipIf(os.name == 'posix', "PYPY: FIXME")
     def test_pool_worker_lifetime(self):
         p = multiprocessing.Pool(3, maxtasksperchild=10)
         self.assertEqual(3, len(p._pool))
@@ -1278,6 +1280,7 @@
         queue = manager.get_queue()
         queue.put('hello world')
 
+    @unittest.skipIf(os.name == 'posix', "PYPY: FIXME")
     def test_rapid_restart(self):
         authkey = os.urandom(32)
         manager = QueueManager(
@@ -1570,6 +1573,7 @@
 
     ALLOWED_TYPES = ('processes',)
 
+    @unittest.skipIf(os.name == 'posix', "PYPY: FIXME")
     def test_heap(self):
         iterations = 5000
         maxblocks = 50
diff --git a/lib-python/2.7/uuid.py b/lib-python/modified-2.7/uuid.py
copy from lib-python/2.7/uuid.py
copy to lib-python/modified-2.7/uuid.py
--- a/lib-python/2.7/uuid.py
+++ b/lib-python/modified-2.7/uuid.py
@@ -406,8 +406,12 @@
             continue
         if hasattr(lib, 'uuid_generate_random'):
             _uuid_generate_random = lib.uuid_generate_random
+            _uuid_generate_random.argtypes = [ctypes.c_char * 16]
+            _uuid_generate_random.restype = None
         if hasattr(lib, 'uuid_generate_time'):
             _uuid_generate_time = lib.uuid_generate_time
+            _uuid_generate_time.argtypes = [ctypes.c_char * 16]
+            _uuid_generate_time.restype = None
 
     # The uuid_generate_* functions are broken on MacOS X 10.5, as noted
     # in issue #8621 the function generates the same sequence of values
@@ -436,6 +440,9 @@
         lib = None
     _UuidCreate = getattr(lib, 'UuidCreateSequential',
                           getattr(lib, 'UuidCreate', None))
+    if _UuidCreate is not None:
+        _UuidCreate.argtypes = [ctypes.c_char * 16]
+        _UuidCreate.restype = ctypes.c_int
 except:
     pass
 
diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -180,9 +180,17 @@
 sqlite.sqlite3_libversion.argtypes = []
 sqlite.sqlite3_libversion.restype = c_char_p
 sqlite.sqlite3_open.argtypes = [c_char_p, c_void_p]
+sqlite.sqlite3_open.restype = c_int
 sqlite.sqlite3_prepare_v2.argtypes = [c_void_p, c_char_p, c_int, c_void_p, 
POINTER(c_char_p)]
+sqlite.sqlite3_prepare_v2.restype = c_int
 sqlite.sqlite3_column_decltype.argtypes = [c_void_p, c_int]
 sqlite.sqlite3_column_decltype.restype = c_char_p
+sqlite.sqlite3_step.argtypes = [c_void_p]
+sqlite.sqlite3_step.restype = c_int
+sqlite.sqlite3_reset.argtypes = [c_void_p]
+sqlite.sqlite3_reset.restype = c_int
+sqlite.sqlite3_column_count.argtypes = [c_void_p]
+sqlite.sqlite3_column_count.restype = c_int
 
 sqlite.sqlite3_result_blob.argtypes = [c_void_p, c_char_p, c_int, c_void_p]
 sqlite.sqlite3_result_int64.argtypes = [c_void_p, c_int64]
@@ -491,7 +499,7 @@
                 return callback(text1, text2)
 
             c_collation_callback = COLLATION(collation_callback)
-            self._collations[name] = collation_callback
+            self._collations[name] = c_collation_callback
 
 
         ret = sqlite.sqlite3_create_collation(self.db, name,
diff --git a/pypy/interpreter/test/test_function.py 
b/pypy/interpreter/test/test_function.py
--- a/pypy/interpreter/test/test_function.py
+++ b/pypy/interpreter/test/test_function.py
@@ -98,6 +98,14 @@
             raises(TypeError, "dir.func_code = f.func_code")
             raises(TypeError, "list.append.im_func.func_code = f.func_code")
 
+    def test_set_module_to_name_eagerly(self):
+        skip("fails on PyPy but works on CPython.  Unsure we want to care")
+        exec '''if 1:
+            __name__ = "foo"
+            def f(): pass
+            __name__ = "bar"
+            assert f.__module__ == "foo"''' in {}
+
 
 class AppTestFunction:
     def test_simple_call(self):
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to