44from django import forms
55from django .core .exceptions import ValidationError
66
7- from netfields .compat import text_type
87from netfields .mac import mac_unix_common , mac_eui64
98
109
@@ -24,7 +23,7 @@ def to_python(self, value):
2423 if isinstance (value , _IPAddressBase ):
2524 return value
2625
27- if isinstance (value , text_type ):
26+ if isinstance (value , str ):
2827 value = value .strip ()
2928
3029 try :
@@ -49,7 +48,7 @@ def to_python(self, value):
4948 if isinstance (value , _IPAddressBase ):
5049 return value
5150
52- if isinstance (value , text_type ):
51+ if isinstance (value , str ):
5352 value = value .strip ()
5453
5554 try :
@@ -75,7 +74,7 @@ def to_python(self, value):
7574 if isinstance (value , _BaseNetwork ):
7675 network = value
7776
78- if isinstance (value , text_type ):
77+ if isinstance (value , str ):
7978 value = value .strip ()
8079
8180 try :
@@ -103,7 +102,7 @@ def to_python(self, value):
103102 if isinstance (value , EUI ):
104103 return value
105104
106- if isinstance (value , text_type ):
105+ if isinstance (value , str ):
107106 value = value .strip ()
108107
109108 try :
@@ -132,7 +131,7 @@ def to_python(self, value):
132131 if isinstance (value , EUI ):
133132 return value
134133
135- if isinstance (value , text_type ):
134+ if isinstance (value , str ):
136135 value = value .strip ()
137136
138137 try :
0 commit comments