Don't use copy.deepcopy; it is buggy on some Python versions.
This commit is contained in:
1 parent
b691d94de4
commit
5c86ea5dfc
1 file changed
+7
-4
@@ -1,5 +1,5 @@
|
||||
import tokenizer
|
||||
import copy
|
||||
|
||||
|
||||
MODIFIERS = ['const', 'volatile'] # XXX: are there others?
|
||||
|
||||
@@ -21,6 +21,9 @@ class CType(object):
|
||||
else:
|
||||
self.tokens = tokens
|
||||
|
||||
def clone(self):
|
||||
return CType(list(self.tokens))
|
||||
|
||||
def reorder_modifiers(self):
|
||||
"""
|
||||
Reoder const modifiers, as rightward as possible without
|
||||
@@ -298,10 +301,10 @@ class TypeTraits(object):
|
||||
|
||||
def __init__(self, ctype):
|
||||
self.ctype = parse_type(ctype)
|
||||
self.ctype_no_modifiers = copy.deepcopy(self.ctype)
|
||||
self.ctype_no_modifiers = self.ctype.clone()
|
||||
self.ctype_no_modifiers.remove_modifiers()
|
||||
self.ctype_no_const = copy.deepcopy(self.ctype)
|
||||
tokens = copy.copy(self.ctype.tokens)
|
||||
self.ctype_no_const = self.ctype.clone()
|
||||
tokens = list(self.ctype.tokens)
|
||||
tokens.reverse()
|
||||
ptr_ref_level = 0
|
||||
self.type_is_const = False
|
||||
|
||||
Reference in new issue
Block a user