15
0

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
This commit is contained in:
Tomáš Chvátal
2018-07-16 13:34:14 +00:00
committed by Git OBS Bridge
parent d63efc57f4
commit 5c78e06fdb
3 changed files with 47 additions and 8 deletions

34
python_37.diff Normal file
View File

@@ -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