diff --git a/pep479.patch b/pep479.patch new file mode 100644 index 0000000..46fda97 --- /dev/null +++ b/pep479.patch @@ -0,0 +1,34 @@ +diff -r 7941677dc77d pygments/lexers/lisp.py +--- a/pygments/lexers/lisp.py Mon Mar 13 19:16:03 2017 +0000 ++++ b/pygments/lexers/lisp.py Wed Jul 04 18:03:07 2018 +0200 +@@ -2327,13 +2327,13 @@ + token = Name.Function if token == Literal else token + yield index, token, value + +- raise StopIteration ++ return + + def _process_signature(self, tokens): + for index, token, value in tokens: + if token == Literal and value == '}': + yield index, Punctuation, value +- raise StopIteration ++ return + elif token in (Literal, Name.Function): + token = Name.Variable if value.istitle() else Keyword.Type + yield index, token, value +diff -r 7941677dc77d pygments/lexers/sql.py +--- a/pygments/lexers/sql.py Mon Mar 13 19:16:03 2017 +0000 ++++ b/pygments/lexers/sql.py Wed Jul 04 18:03:07 2018 +0200 +@@ -347,7 +347,10 @@ + # Emit the output lines + out_token = Generic.Output + while 1: +- line = next(lines) ++ try: ++ line = next(lines) ++ except StopIteration: ++ return + mprompt = re_prompt.match(line) + if mprompt is not None: + # push the line back to have it processed by the prompt diff --git a/python-pygments.spec b/python-pygments.spec index c871dff..6888f90 100644 --- a/python-pygments.spec +++ b/python-pygments.spec @@ -8,13 +8,16 @@ Name: python-pygments Version: 2.2.0 -Release: 12%{?dist} +Release: 13%{?dist} Summary: %{sum} License: BSD URL: http://pygments.org/ Source0: https://pypi.org/packages/source/P/%{upstream_name}/%{upstream_name}-%{version}.tar.gz Patch0: import-directive.patch +# Support for Python 3.7: +# https://bitbucket.org/birkenfeld/pygments-main/issues/1457 +Patch1: pep479.patch BuildArch: noarch %description @@ -79,6 +82,7 @@ need to prettify source code. Highlights are: %prep %setup -q -n %{upstream_name}-%{version} %patch0 -p 1 +%patch1 -p 1 %build %{__sed} -i 's/\r//' LICENSE @@ -105,7 +109,8 @@ cp -r doc/docs doc/reST %endif %check -make test || : +make test PYTHON=%{__python2} +make test PYTHON=%{__python3} %files -n python2-pygments @@ -129,6 +134,10 @@ make test || : %endif %changelog +* Wed Jul 04 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-13 +- Run tests +- Add fix for 3.7 + * Thu Jun 14 2018 Miro Hrončok <mhroncok@redhat.com> - 2.2.0-12 - Rebuilt for Python 3.7