diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2017-10-23 17:40:36 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2017-10-23 17:40:36 (GMT) |
commit | a5f9d24c171c7e3a3715161fd16b747c7dcaf76f (patch) | |
tree | f31345fb6b83d5ae23015133fc6ebd1319f096f3 | |
parent | 6e45d7b90accbbdfef353c41ab0a78a3e4742803 (diff) | |
download | cpython-a5f9d24c171c7e3a3715161fd16b747c7dcaf76f.zip cpython-a5f9d24c171c7e3a3715161fd16b747c7dcaf76f.tar.gz cpython-a5f9d24c171c7e3a3715161fd16b747c7dcaf76f.tar.bz2 |
bpo-30722: Make redemo work with Python 3.6+ (GH-2311)
(cherry picked from commit 62adc55aff0b78447568f73bd1abc610d2784bf8)
-rw-r--r-- | Misc/NEWS.d/next/Tools-Demos/2017-10-23-19-45-52.bpo-30722.ioRlAu.rst | 9 | ||||
-rwxr-xr-x | Tools/demo/redemo.py | 3 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Misc/NEWS.d/next/Tools-Demos/2017-10-23-19-45-52.bpo-30722.ioRlAu.rst b/Misc/NEWS.d/next/Tools-Demos/2017-10-23-19-45-52.bpo-30722.ioRlAu.rst new file mode 100644 index 0000000..2d20c4b --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2017-10-23-19-45-52.bpo-30722.ioRlAu.rst @@ -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. diff --git a/Tools/demo/redemo.py b/Tools/demo/redemo.py index 8335d4c..256a63e 100755 --- a/Tools/demo/redemo.py +++ b/Tools/demo/redemo.py @@ -75,7 +75,6 @@ class ReDemo: self.boxes = [] self.vars = [] for name in ('IGNORECASE', - 'LOCALE', 'MULTILINE', 'DOTALL', 'VERBOSE'): @@ -83,7 +82,7 @@ class ReDemo: 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, |