Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
python-nexlibs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
python-nexlibs
Commits
0833f5cf
Commit
0833f5cf
authored
Jul 19, 2020
by
root
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for python3
parent
b8c4a334
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
singleton.py
nexlibs/singleton.py
+5
-2
webutils.py
nexlibs/utils/webutils.py
+1
-1
No files found.
nexlibs/singleton.py
View file @
0833f5cf
...
...
@@ -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
):
...
...
@@ -202,4 +205,4 @@ if __name__ == '__main__':
unittest
.
main
()
\ No newline at end of file
nexlibs/utils/webutils.py
View file @
0833f5cf
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment