[pypy-svn] r23375 - in pypy/dist/pypy: interpreter module/thread
arigo at codespeak.net
arigo at codespeak.net
Wed Feb 15 18:34:21 CET 2006
Author: arigo
Date: Wed Feb 15 18:34:17 2006
New Revision: 23375
Modified:
pypy/dist/pypy/interpreter/argument.py
pypy/dist/pypy/module/thread/os_local.py
Log:
Fix the thread-local class, broken since the Arguments optimization.
Modified: pypy/dist/pypy/interpreter/argument.py
==============================================================================
--- pypy/dist/pypy/interpreter/argument.py (original)
+++ pypy/dist/pypy/interpreter/argument.py Wed Feb 15 18:34:17 2006
@@ -81,6 +81,15 @@
scope_w = [None] * scopelen
self._match_signature(scope_w, argnames, has_vararg, has_kwarg, defaults_w, 0, None)
return scope_w
+
+ def normalize(self):
+ """Return an instance of the Arguments class. (Instances of other
+ classes may not be suitable for long-term storage or multiple
+ usage.) Also force the type and validity of the * and ** arguments
+ to be checked now.
+ """
+ args_w, kwds_w = self.unpack()
+ return Arguments(self.space, args_w, kwds_w)
class ArgumentsPrepended(AbstractArguments):
def __init__(self, args, w_firstarg):
@@ -148,9 +157,9 @@
"""
def __init__(self, space, valuestack, nargs=0):
- self.space = space
- self.valuestack = valuestack
- self.nargs = nargs
+ self.space = space
+ self.valuestack = valuestack
+ self.nargs = nargs
def firstarg(self):
if self.nargs <= 0:
Modified: pypy/dist/pypy/module/thread/os_local.py
==============================================================================
--- pypy/dist/pypy/module/thread/os_local.py (original)
+++ pypy/dist/pypy/module/thread/os_local.py Wed Feb 15 18:34:17 2006
@@ -15,7 +15,7 @@
def __init__(self, space, initargs):
self.space = space
- self.initargs = initargs
+ self.initargs = initargs.normalize()
ident = thread.get_ident()
self.dicts = {ident: space.newdict([])}
More information about the Pypy-commit
mailing list