Author: Carl Friedrich Bolz <[email protected]>
Branch: space-newtext
Changeset: r88120:35acc5809da1
Date: 2016-11-03 12:55 +0100
http://bitbucket.org/pypy/pypy/changeset/35acc5809da1/
Log: thread
diff --git a/pypy/module/thread/error.py b/pypy/module/thread/error.py
--- a/pypy/module/thread/error.py
+++ b/pypy/module/thread/error.py
@@ -6,4 +6,4 @@
def wrap_thread_error(space, msg):
w_error = space.fromcache(Cache).w_error
- return OperationError(w_error, space.wrap(msg))
+ return OperationError(w_error, space.newtext(msg))
diff --git a/pypy/module/thread/os_local.py b/pypy/module/thread/os_local.py
--- a/pypy/module/thread/os_local.py
+++ b/pypy/module/thread/os_local.py
@@ -51,7 +51,7 @@
# call __init__
try:
w_type = space.type(self)
- w_init = space.getattr(w_type, space.wrap("__init__"))
+ w_init = space.getattr(w_type, space.newtext("__init__"))
space.call_obj_args(w_init, self, self.initargs)
except:
# failed, forget w_dict and propagate the exception
@@ -76,7 +76,7 @@
def descr_local__new__(space, w_subtype, __args__):
local = space.allocate_instance(Local, w_subtype)
Local.__init__(local, space, __args__)
- return space.wrap(local)
+ return local
def descr_local__init__(self, space):
# No arguments allowed
diff --git a/pypy/module/thread/os_lock.py b/pypy/module/thread/os_lock.py
--- a/pypy/module/thread/os_lock.py
+++ b/pypy/module/thread/os_lock.py
@@ -160,4 +160,4 @@
def allocate_lock(space):
"""Create a new lock object. (allocate() is an obsolete synonym.)
See LockType.__doc__ for information about locks."""
- return space.wrap(Lock(space))
+ return Lock(space)
diff --git a/pypy/module/thread/test/test_local.py
b/pypy/module/thread/test/test_local.py
--- a/pypy/module/thread/test/test_local.py
+++ b/pypy/module/thread/test/test_local.py
@@ -123,6 +123,7 @@
return {}
def wrap(self, obj):
return obj
+ newtext = wrap
def type(self, obj):
return type(obj)
class config:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit