From 5c78e06fdba5b2bb74cb954ec429a22e980664dec386e2cb3a6095ebb33d3af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Mon, 16 Jul 2018 13:34:14 +0000 Subject: [PATCH] Accepting request 623133 from home:mimi_vx:branches:devel:languages:python - add python_37.diff - fixes build with python-3.7+ OBS-URL: https://build.opensuse.org/request/show/623133 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Pygments?expand=0&rev=42 --- python-Pygments.changes | 5 +++++ python-Pygments.spec | 16 ++++++++-------- python_37.diff | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 python_37.diff diff --git a/python-Pygments.changes b/python-Pygments.changes index 8aec393..99b274c 100644 --- a/python-Pygments.changes +++ b/python-Pygments.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 16 13:21:03 UTC 2018 - mimi.vx@gmail.com + +- add python_37.diff - fixes build with python-3.7+ + ------------------------------------------------------------------- Tue Aug 15 12:52:00 UTC 2017 - dmueller@suse.com diff --git a/python-Pygments.spec b/python-Pygments.spec index 34f6aab..d3ee235 100644 --- a/python-Pygments.spec +++ b/python-Pygments.spec @@ -1,7 +1,7 @@ # # spec file for package python-Pygments # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,24 +20,23 @@ Name: python-Pygments Version: 2.2.0 Release: 0 -Url: http://pygments.org Summary: Pygments is a syntax highlighting package written in Python License: BSD-2-Clause Group: Development/Languages/Python +URL: http://pygments.org Source: https://files.pythonhosted.org/packages/source/P/Pygments/Pygments-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Patch0: python_37.diff BuildRequires: %{python_module devel} BuildRequires: %{python_module nose} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros +Requires: python-setuptools Requires(post): update-alternatives Requires(postun): update-alternatives -Requires: python-setuptools Provides: python-pygments = %{version} Obsoletes: python-pygments < %{version} BuildArch: noarch - %python_subpackages %description @@ -57,6 +56,7 @@ source code. Highlights are: %prep %setup -q -n Pygments-%{version} +%patch0 -p1 # Remove non-oss licensed files, see bnc# 760344 rm tests/examplefiles/{Sorting,test}.mod @@ -68,7 +68,7 @@ rm tests/examplefiles/{Sorting,test}.mod %{python_expand %$python_install mv %{buildroot}%{_bindir}/pygmentize %{buildroot}%{_bindir}/pygmentize-%{$python_bin_suffix} %fdupes -s %{buildroot}%{$python_sitelib} -%if "%python3_bin_suffix" != "" +%if "%{python3_bin_suffix}" != "" install -Dm0644 doc/pygmentize.1 %{buildroot}%{_mandir}/man1/pygmentize.1 %endif } @@ -86,8 +86,8 @@ export PYTHONDEBUG=1 %python_exec tests/run.py %files %{python_files} -%defattr(-,root,root,-) -%doc LICENSE AUTHORS CHANGES TODO +%license LICENSE +%doc AUTHORS CHANGES TODO %python_alternative %{_bindir}/pygmentize %python3_only %{_mandir}/man1/pygmentize.1* %{python_sitelib}/pygments/ diff --git a/python_37.diff b/python_37.diff new file mode 100644 index 0000000..3061344 --- /dev/null +++ b/python_37.diff @@ -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