new __new__ syntax
This commit is contained in:
1 parent
5b701ea095
commit
31f6c88b9d
2 files changed
+3
-3
No files matched your search
@@ -1 +1 @@
|
|||||||
Version 1.99.4 (2011-12-30 22:48:16) stable
|
Version 1.99.4 (2011-12-31 11:47:41) stable
|
||||||
+2
-2
@@ -4074,7 +4074,7 @@ class PluginManager(object):
|
|||||||
True
|
True
|
||||||
"""
|
"""
|
||||||
instances = {}
|
instances = {}
|
||||||
def __new__(cls,*a,**b):
|
def __new__(cls):
|
||||||
id = thread.get_ident()
|
id = thread.get_ident()
|
||||||
lock = thread.allocate_lock()
|
lock = thread.allocate_lock()
|
||||||
try:
|
try:
|
||||||
@@ -4082,7 +4082,7 @@ class PluginManager(object):
|
|||||||
try:
|
try:
|
||||||
return cls.instances[id]
|
return cls.instances[id]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
instance = object.__new__(cls,*a,**b)
|
instance = object.__new__(cls)
|
||||||
cls.instances[id] = instance
|
cls.instances[id] = instance
|
||||||
return instance
|
return instance
|
||||||
finally:
|
finally:
|
||||||
|
|||||||
Reference in new issue
Block a user