Author: Armin Rigo <[email protected]>
Branch: stm-thread
Changeset: r54933:2a0cce4e6995
Date: 2012-05-07 13:29 +0200
http://bitbucket.org/pypy/pypy/changeset/2a0cce4e6995/
Log: Revert again the introduction of '__pypy__.local'.
diff --git a/lib_pypy/_ctypes/builtin.py b/lib_pypy/_ctypes/builtin.py
--- a/lib_pypy/_ctypes/builtin.py
+++ b/lib_pypy/_ctypes/builtin.py
@@ -1,6 +1,10 @@
import _rawffi, sys
-from __pypy__ import local
+try:
+ from thread import _local as local
+except ImportError:
+ class local(object): # no threads
+ pass
class ConvMode:
encoding = 'ascii'
diff --git a/pypy/module/__pypy__/__init__.py b/pypy/module/__pypy__/__init__.py
--- a/pypy/module/__pypy__/__init__.py
+++ b/pypy/module/__pypy__/__init__.py
@@ -29,7 +29,6 @@
class Module(MixedModule):
appleveldefs = {
- 'local' : 'app_local.local',
}
interpleveldefs = {
diff --git a/pypy/module/__pypy__/app_local.py
b/pypy/module/__pypy__/app_local.py
deleted file mode 100644
--- a/pypy/module/__pypy__/app_local.py
+++ /dev/null
@@ -1,11 +0,0 @@
-import sys
-
-if 'thread' in sys.builtin_module_names:
- from thread import _local as local
-elif 'transaction' in sys.builtin_module_names:
- from transaction import local
-else:
- class local(object):
- """A pseudo-thread-local class.
- As this interpreter does not have threads, it is a regular class.
- """
diff --git a/pypy/module/__pypy__/test/test_local.py
b/pypy/module/__pypy__/test/test_local.py
deleted file mode 100644
--- a/pypy/module/__pypy__/test/test_local.py
+++ /dev/null
@@ -1,19 +0,0 @@
-import py
-from pypy.conftest import gettestobjspace
-
-
-class AppTestLocal(object):
- def test_local(self):
- import __pypy__
- x = __pypy__.local()
- x.foo = 42
- assert x.foo == 42 # hard to test more :-)
-
-
-class AppTestLocalWithThreads(object):
- def setup_class(cls):
- cls.space = gettestobjspace(usemodules=['thread'])
-
- def test_local(self):
- import __pypy__, thread
- assert __pypy__.local is thread._local
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit