File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -1284,16 +1284,19 @@ class Table(object):
12841284
12851285 _cache = weakref .WeakValueDictionary ()
12861286
1287- def __new__ (cls , name , autocommit = True ):
1287+ def __new__ (cls , name , autocommit = None ):
12881288 obj = Table ._cache .get (name , None )
12891289 if not obj :
12901290 obj = object .__new__ (cls )
1291+ if autocommit is None :
1292+ autocommit = True
1293+ obj ._init (name , autocommit )
12911294 Table ._cache [name ] = obj
1292- else :
1295+ elif autocommit is not None :
12931296 obj .autocommit = autocommit
12941297 return obj
12951298
1296- def __init__ (self , name , autocommit = True ):
1299+ def _init (self , name , autocommit ):
12971300 """
12981301 *name* is the name of the table, if it already exists it is returned.
12991302 *autocommit* specifies that any iptables operation that changes a
You can’t perform that action at this time.
0 commit comments