Skip to content

Commit d94139a

Browse files
committed
fix issue 9117
1 parent f706095 commit d94139a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

modules/swagger-codegen/src/main/resources/python/configuration.mustache

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ class TypeWithDefault(type):
2222
def __call__(cls):
2323
if cls._default is None:
2424
cls._default = type.__call__(cls)
25-
return copy.copy(cls._default)
25+
return cls._two_level_copy(cls._default)
2626

2727
def set_default(cls, default):
28-
cls._default = copy.copy(default)
28+
cls._default = cls._two_level_copy(default)
29+
30+
def _two_level_copy(cls, obj):
31+
newone = copy.copy(obj)
32+
for key in obj.__dict__.keys():
33+
newone.__dict__[key] = copy.copy(obj.__dict__[key])
34+
return newone
2935

3036

3137
class Configuration(six.with_metaclass(TypeWithDefault, object)):

0 commit comments

Comments
 (0)