remove most of Python2 compatibility code

This commit is contained in:
Alexandre Detiste
2024-03-22 00:06:03 +01:00
committed by Scott Talbert
parent beb9932241
commit 0257f755cf
108 changed files with 220 additions and 2144 deletions

View File

@@ -47,11 +47,7 @@ import six
MAXSIZE = six.MAXSIZE # (constants should be in upper case)
MINSIZE = -six.MAXSIZE-1
if six.PY2:
LONGTYPE = long
else:
LONGTYPE = int
LONGTYPE = int
#----------------------------------------------------------------------------
@@ -469,10 +465,7 @@ class IntCtrl(wx.TextCtrl):
self.__default_color = wx.BLACK
self.__oob_color = wx.RED
self.__allow_none = 0
if six.PY2:
self.__allow_long = 0
else:
self.__allow_long = 1
self.__allow_long = 1
self.__oldvalue = None
if validator == wx.DefaultValidator:
@@ -491,10 +484,7 @@ class IntCtrl(wx.TextCtrl):
self.SetLimited(limited)
self.SetColors(default_color, oob_color)
self.SetNoneAllowed(allow_none)
if six.PY2:
self.SetLongAllowed(allow_long)
else:
self.SetLongAllowed(1)
self.SetLongAllowed(1)
self.ChangeValue(value)
def OnText( self, event ):
@@ -708,7 +698,7 @@ class IntCtrl(wx.TextCtrl):
value = self.GetValue()
if( not (value is None and self.IsNoneAllowed())
and type(value) not in six.integer_types ):
and type(value) not in int ):
raise ValueError (
'IntCtrl requires integer values, passed %s'% repr(value) )
@@ -820,7 +810,7 @@ class IntCtrl(wx.TextCtrl):
elif type(value) == LONGTYPE and not self.IsLongAllowed():
raise ValueError (
'IntCtrl requires integer value, passed long' )
elif type(value) not in six.integer_types:
elif type(value) not in int:
raise ValueError (
'IntCtrl requires integer value, passed %s'% repr(value) )