Skip to content

Commit

Permalink
fix: update singleton
Browse files Browse the repository at this point in the history
  • Loading branch information
iuiaoin committed Jul 19, 2023
1 parent c4dfe79 commit d06d63e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/singleton.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ def singleton(cls):
instances = {}

class Singleton(cls):
def __new__(cls, *args, **kwargs):
def __new__(cls):
if cls not in instances:
instances[cls] = super(Singleton, cls).__new__(cls, *args, **kwargs)
instances[cls] = super(Singleton, cls).__new__(cls)
return instances[cls]

Singleton.__name__ = cls.__name__
Expand Down

0 comments on commit d06d63e

Please sign in to comment.