Add default value None to __new__ method, this avoid exception when
__deepcopy__ method used

Change-Id: I744d293818e7019a188f9b093d2cf12c47f1f2b4
This commit is contained in:
Larry GUO 2017-12-27 06:08:06 +00:00
parent b3ad6de337
commit 784227cce4
1 changed files with 1 additions and 1 deletions

View File

@ -132,7 +132,7 @@ class Constraint(object):
'less_or_equal', 'in_range', 'valid_values', 'length',
'min_length', 'max_length', 'pattern')
def __new__(cls, property_name, property_type, constraint):
def __new__(cls, property_name=None, property_type=None, constraint=None):
if cls is not Constraint:
return super(Constraint, cls).__new__(cls)