Commit 0833f5cf authored by root's avatar root

Fix for python3

parent b8c4a334
......@@ -58,6 +58,8 @@ Call <Class>.getInstance() to get the single instance of <Class>.
Any arguments passed to <Class>.getInstance() will be passed on
to your <Class>.__init__.
"""
import six
class SingletonException(Exception):
pass
......@@ -96,7 +98,8 @@ class Singleton(object, metaclass=MetaSingleton):
_isInstantiated = classmethod(_isInstantiated)
def _getConstructionArgCountNotCountingSelf(cls):
return cls.__init__.__func__.__code__.co_argcount - 1
#return cls.__init__.__func__.__code__.co_argcount - 1
return six.get_function_code(cls.__init__).co_argument -1
_getConstructionArgCountNotCountingSelf = classmethod(_getConstructionArgCountNotCountingSelf)
def _forgetClassInstanceReferenceForTesting(cls):
......
......@@ -21,7 +21,7 @@
from twisted.web import client, error, http
from twisted.internet import protocol, reactor, defer, task
from twisted.python import failure
from twisted.python.compat import nativeString, intToBytes, str, itervalues
from twisted.python.compat import nativeString, intToBytes, itervalues
from urllib.parse import urlunparse
from urllib.parse import splithost, splittype
import gzip
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment