[pypy-commit] pypy py3.3: Fix import of _sqlite3 (needed by the buildbot "compress" step)

amauryfa noreply at buildbot.pypy.org
Mon Apr 21 18:36:36 CEST 2014


Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch: py3.3
Changeset: r70821:84aebbaf3a3c
Date: 2014-04-21 18:35 +0200
http://bitbucket.org/pypy/pypy/changeset/84aebbaf3a3c/

Log:	Fix import of _sqlite3 (needed by the buildbot "compress" step)

diff --git a/lib_pypy/_sqlite3.py b/lib_pypy/_sqlite3.py
--- a/lib_pypy/_sqlite3.py
+++ b/lib_pypy/_sqlite3.py
@@ -29,7 +29,8 @@
 import string
 import sys
 import weakref
-from threading import _get_ident as _thread_get_ident
+import threading
+
 try:
     from __pypy__ import newlist_hint
 except ImportError:
@@ -458,7 +459,7 @@
         self.__aggregate_instances = {}
         self.__collations = {}
         if check_same_thread:
-            self.__thread_ident = _thread_get_ident()
+            self.__thread_ident = threading.get_ident()
 
         self.Error = Error
         self.Warning = Warning
@@ -501,7 +502,7 @@
 
     def _check_thread(self):
         try:
-            if self.__thread_ident == _thread_get_ident():
+            if self.__thread_ident == threading.get_ident():
                 return
         except AttributeError:
             pass
@@ -509,7 +510,7 @@
             raise ProgrammingError(
                 "SQLite objects created in a thread can only be used in that "
                 "same thread. The object was created in thread id %d and this "
-                "is thread id %d", self.__thread_ident, _thread_get_ident())
+                "is thread id %d", self.__thread_ident, threading.get_ident())
 
     def _check_thread_wrap(func):
         @wraps(func)


More information about the pypy-commit mailing list