Skip to content

Commit

Permalink
bpo-30722: Make redemo work with Python 3.6+ (GH-2311)
Browse files Browse the repository at this point in the history
  • Loading branch information
csarn authored and berkerpeksag committed Oct 23, 2017
1 parent 66caacf commit 62adc55
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
@@ -0,0 +1,9 @@
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.
3 changes: 1 addition & 2 deletions Tools/demo/redemo.py
Expand Up @@ -75,15 +75,14 @@ def addoptions(self):
self.boxes = []
self.vars = []
for name in ('IGNORECASE',
'LOCALE',
'MULTILINE',
'DOTALL',
'VERBOSE'):
if len(self.boxes) % 3 == 0:
frame = Frame(self.master)
frame.pack(fill=X)
self.frames.append(frame)
val = getattr(re, name)
val = getattr(re, name).value
var = IntVar()
box = Checkbutton(frame,
variable=var, text=name,
Expand Down

0 comments on commit 62adc55

Please sign in to comment.