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

@@ -17,7 +17,6 @@ This is where FloatCanvas defines its drawings objects.
import sys
import wx
import six
import numpy as N
@@ -228,14 +227,8 @@ class DrawObject:
if not self._Canvas.HitColorGenerator:
# first call to prevent the background color from being used.
self._Canvas.HitColorGenerator = _colorGenerator()
if six.PY3:
next(self._Canvas.HitColorGenerator)
else:
self._Canvas.HitColorGenerator.next()
if six.PY3:
self.HitColor = next(self._Canvas.HitColorGenerator)
else:
self.HitColor = self._Canvas.HitColorGenerator.next()
next(self._Canvas.HitColorGenerator)
self.HitColor = next(self._Canvas.HitColorGenerator)
self.SetHitPen(self.HitColor,self.HitLineWidth)
self.SetHitBrush(self.HitColor)
# put the object in the hit dict, indexed by it's color
@@ -2890,15 +2883,9 @@ class Group(DrawObject):
if not self._Canvas.HitColorGenerator:
self._Canvas.HitColorGenerator = _colorGenerator()
# first call to prevent the background color from being used.
if six.PY2:
self._Canvas.HitColorGenerator.next()
else:
next(self._Canvas.HitColorGenerator)
next(self._Canvas.HitColorGenerator)
# Set all contained objects to the same Hit color:
if six.PY2:
self.HitColor = self._Canvas.HitColorGenerator.next()
else:
self.HitColor = next(self._Canvas.HitColorGenerator)
self.HitColor = next(self._Canvas.HitColorGenerator)
self._ChangeChildrenHitColor(self.ObjectList)
# put the object in the hit dict, indexed by it's color
if not self._Canvas.HitDict: