Skip to content

Commit ec130f4

Browse files
committed
Merge branch 'config' into O21U_repro_2
2 parents 0ad4d4c + 51c345e commit ec130f4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

narps_open/utils/singleton.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ class SingletonMeta(type):
1919

2020
def __call__(cls, *args, **kwargs):
2121
""" Creating only one instance for the class 'cls' """
22-
with cls._lock:
23-
if cls not in cls._instances:
22+
if cls not in cls._instances:
23+
with cls._lock:
2424
instance = super().__call__(*args, **kwargs)
2525
cls._instances[cls] = instance
26+
2627
return cls._instances[cls]

0 commit comments

Comments
 (0)