mirror of
https://github.com/python/cpython.git
synced 2025-10-03 21:55:41 +00:00
Merged revisions 68708 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r68708 | jesse.noller | 2009-01-17 20:45:38 -0600 (Sat, 17 Jan 2009) | 1 line Resolve issue 4449: AssertionError in mp_benchmarks.py ........
This commit is contained in:
parent
0293c80410
commit
afd7eaadb0
3 changed files with 27 additions and 9 deletions
|
@ -69,9 +69,12 @@ def Value(typecode_or_type, *args, **kwds):
|
|||
if kwds:
|
||||
raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys())
|
||||
obj = RawValue(typecode_or_type, *args)
|
||||
if lock is None:
|
||||
if lock is False:
|
||||
return obj
|
||||
if lock in (True, None):
|
||||
lock = RLock()
|
||||
assert hasattr(lock, 'acquire')
|
||||
if not hasattr(lock, 'acquire'):
|
||||
raise AttributeError("'%r' has no method 'acquire'" % lock)
|
||||
return synchronized(obj, lock)
|
||||
|
||||
def Array(typecode_or_type, size_or_initializer, **kwds):
|
||||
|
@ -82,9 +85,12 @@ def Array(typecode_or_type, size_or_initializer, **kwds):
|
|||
if kwds:
|
||||
raise ValueError('unrecognized keyword argument(s): %s' % kwds.keys())
|
||||
obj = RawArray(typecode_or_type, size_or_initializer)
|
||||
if lock is None:
|
||||
if lock is False:
|
||||
return obj
|
||||
if lock in (True, None):
|
||||
lock = RLock()
|
||||
assert hasattr(lock, 'acquire')
|
||||
if not hasattr(lock, 'acquire'):
|
||||
raise AttributeError("'%r' has no method 'acquire'" % lock)
|
||||
return synchronized(obj, lock)
|
||||
|
||||
def copy(obj):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue