Skip to content

Commit 62adc55

Browse files
csarnberkerpeksag
authored andcommitted
bpo-30722: Make redemo work with Python 3.6+ (GH-2311)
1 parent 66caacf commit 62adc55

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Make redemo work with Python 3.6 and newer versions.
2+
3+
In Python 3.6, flags like re.DOTALL became members of an enum.IntFlag so
4+
usages like ``getattr(re, 'DOTALL')`` are invalid.
5+
6+
Also, remove the ``LOCALE`` option since it doesn't work with string
7+
patterns in Python 3.
8+
9+
Patch by Christoph Sarnowski.

Tools/demo/redemo.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,14 @@ def addoptions(self):
7575
self.boxes = []
7676
self.vars = []
7777
for name in ('IGNORECASE',
78-
'LOCALE',
7978
'MULTILINE',
8079
'DOTALL',
8180
'VERBOSE'):
8281
if len(self.boxes) % 3 == 0:
8382
frame = Frame(self.master)
8483
frame.pack(fill=X)
8584
self.frames.append(frame)
86-
val = getattr(re, name)
85+
val = getattr(re, name).value
8786
var = IntVar()
8887
box = Checkbutton(frame,
8988
variable=var, text=name,

0 commit comments

Comments
 (0)