We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e167818 commit 8def4a9Copy full SHA for 8def4a9
1 file changed
iptc/ip6tc.py
@@ -576,16 +576,19 @@ class Table6(Table):
576
577
_cache = weakref.WeakValueDictionary()
578
579
- def __new__(cls, name, autocommit=True):
+ def __new__(cls, name, autocommit=None):
580
obj = Table6._cache.get(name, None)
581
if not obj:
582
obj = object.__new__(cls)
583
+ if autocommit is None:
584
+ autocommit = True
585
+ obj._init(name, autocommit)
586
Table6._cache[name] = obj
- else:
587
+ elif autocommit is not None:
588
obj.autocommit = autocommit
589
return obj
590
- def __init__(self, name, autocommit=True):
591
+ def _init(self, name, autocommit):
592
"""
593
Here *name* is the name of the table to instantiate, if it has already
594
been instantiated the existing cached object is returned.
0 commit comments