bpo-30722: Make redemo work with Python 3.6+ (GH-2311) · python/cpython@62adc55 (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change
@@ -75,15 +75,14 @@ def addoptions(self):
75 75 self.boxes = []
76 76 self.vars = []
77 77 for name in ('IGNORECASE',
78 -'LOCALE',
79 78 'MULTILINE',
80 79 'DOTALL',
81 80 'VERBOSE'):
82 81 if len(self.boxes) % 3 == 0:
83 82 frame = Frame(self.master)
84 83 frame.pack(fill=X)
85 84 self.frames.append(frame)
86 -val = getattr(re, name)
85 +val = getattr(re, name).value
87 86 var = IntVar()
88 87 box = Checkbutton(frame,
89 88 variable=var, text=name,