From 5104e34cdfcfdbc6dff448f1df43d47261bded29893a5f86ac86e5ff017be926 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 2 Feb 2022 22:02:33 +0000 Subject: [PATCH] - syntaxerror_failing_test.patch (from https://github.com/bpython/bpython/compare/fdd4ad9..4d33cc6). OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-bpython?expand=0&rev=22 --- python-bpython.changes | 4 +- python-bpython.spec | 1 + syntaxerror_failing_test.patch | 74 +++++++++++++++++++++++++++------- 3 files changed, 63 insertions(+), 16 deletions(-) diff --git a/python-bpython.changes b/python-bpython.changes index 4fd05d3..17bf6b8 100644 --- a/python-bpython.changes +++ b/python-bpython.changes @@ -4,8 +4,8 @@ Wed Feb 2 20:04:24 UTC 2022 - Matej Cepl - Fix failing tests: - typing_extensions.patch (post Python 3.8 we don't need typing_extensions package at all) - - syntaxerror_failing_test.patch (This is actually fixed in the - post-0.22.1 development, but waiting on it.) + - syntaxerror_failing_test.patch (from + https://github.com/bpython/bpython/compare/fdd4ad9..4d33cc6). ------------------------------------------------------------------- Sun Jan 23 17:31:17 UTC 2022 - Arun Persaud diff --git a/python-bpython.spec b/python-bpython.spec index 60fc1dd..856d1b9 100644 --- a/python-bpython.spec +++ b/python-bpython.spec @@ -31,6 +31,7 @@ Source: https://files.pythonhosted.org/packages/source/b/bpython/bpython Patch0: typing_extensions.patch # PATCH-FIX-UPSTREAM syntaxerror_failing_test.patch gh#bpython/bpython#952 mcepl@suse.com # This is actually fixed in the post-0.22.1 development, but waiting on it. +# https://github.com/bpython/bpython/compare/fdd4ad9..4d33cc6.patch Patch1: syntaxerror_failing_test.patch BuildRequires: %{python_module Babel} BuildRequires: %{python_module Sphinx} diff --git a/syntaxerror_failing_test.patch b/syntaxerror_failing_test.patch index 5e96e08..00585d6 100644 --- a/syntaxerror_failing_test.patch +++ b/syntaxerror_failing_test.patch @@ -1,19 +1,65 @@ ---- - bpython/test/test_interpreter.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) +From b46afa3bb1ab783c96dc80c5184090a171ab70d4 Mon Sep 17 00:00:00 2001 +From: Sebastian Ramacher +Date: Fri, 31 Dec 2021 14:00:46 +0100 +Subject: [PATCH 1/3] Apply black +--- + bpython/autocomplete.py | 1 - + bpython/curtsiesfrontend/filewatch.py | 1 - + bpython/test/test_interpreter.py | 14 +++++++++++++- + bpython/urwid.py | 1 - + 4 files changed, 13 insertions(+), 4 deletions(-) + +--- a/bpython/autocomplete.py ++++ b/bpython/autocomplete.py +@@ -626,7 +626,6 @@ except ImportError: + def locate(self, cursor_offset: int, line: str) -> Optional[LinePart]: + return None + +- + else: + + class JediCompletion(BaseCompletionType): +--- a/bpython/curtsiesfrontend/filewatch.py ++++ b/bpython/curtsiesfrontend/filewatch.py +@@ -11,7 +11,6 @@ except ImportError: + def ModuleChangedEventHandler(*args): + return None + +- + else: + + class ModuleChangedEventHandler(FileSystemEventHandler): # type: ignore [no-redef] --- a/bpython/test/test_interpreter.py +++ b/bpython/test/test_interpreter.py -@@ -41,10 +41,10 @@ class TestInterpreter(unittest.TestCase) - + green('""') - + ", line " - + bold(magenta("1")) -- + "\n 1.1.1.1\n ^^^^^\n" +@@ -35,7 +35,19 @@ class TestInterpreter(unittest.TestCase) + + i.runsource("1.1.1.1") + +- if sys.version_info[:2] >= (3, 10): ++ if (3, 10, 1) <= sys.version_info[:3]: ++ expected = ( ++ " File " ++ + green('""') ++ + ", line " ++ + bold(magenta("1")) + + "\n 1.1.1.1\n ^^\n" - + bold(red("SyntaxError")) - + ": " -- + cyan("invalid syntax. Perhaps you forgot a comma?") ++ + bold(red("SyntaxError")) ++ + ": " + + cyan("invalid syntax") - + "\n" - ) - elif (3, 8) <= sys.version_info[:2] <= (3, 9): ++ + "\n" ++ ) ++ elif (3, 10) <= sys.version_info[:2]: + expected = ( + " File " + + green('""') +--- a/bpython/urwid.py ++++ b/bpython/urwid.py +@@ -128,7 +128,6 @@ if urwid.VERSION < (1, 0, 0) and hasattr + + return wrapper + +- + else: + TwistedEventLoop = getattr(urwid, "TwistedEventLoop", None) +