Commit 62adc55a authored by Christoph Sarnowski's avatar Christoph Sarnowski Committed by Berker Peksag

bpo-30722: Make redemo work with Python 3.6+ (GH-2311)

parent 66caacf2
Make redemo work with Python 3.6 and newer versions.
In Python 3.6, flags like re.DOTALL became members of an enum.IntFlag so
usages like ``getattr(re, 'DOTALL')`` are invalid.
Also, remove the ``LOCALE`` option since it doesn't work with string
patterns in Python 3.
Patch by Christoph Sarnowski.
...@@ -75,7 +75,6 @@ class ReDemo: ...@@ -75,7 +75,6 @@ class ReDemo:
self.boxes = [] self.boxes = []
self.vars = [] self.vars = []
for name in ('IGNORECASE', for name in ('IGNORECASE',
'LOCALE',
'MULTILINE', 'MULTILINE',
'DOTALL', 'DOTALL',
'VERBOSE'): 'VERBOSE'):
...@@ -83,7 +82,7 @@ class ReDemo: ...@@ -83,7 +82,7 @@ class ReDemo:
frame = Frame(self.master) frame = Frame(self.master)
frame.pack(fill=X) frame.pack(fill=X)
self.frames.append(frame) self.frames.append(frame)
val = getattr(re, name) val = getattr(re, name).value
var = IntVar() var = IntVar()
box = Checkbutton(frame, box = Checkbutton(frame,
variable=var, text=name, variable=var, text=name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment