14
0
Files
python-feedparser/py37.patch
Tomáš Chvátal 1996bea540 Accepting request 690091 from home:jayvdb:branches:devel:languages:python
- Activate and fix test suite, removing bcond 'tests'
- Add Requires sgmllib3k to fix exception in Python 3 when
  using the loose parser:
  UnboundLocalError: local variable 'feedparser' referenced before assignment
  and less clear but similarly broken result with the strict
  parser.
- Add catch-gzip-error.patch to fix fetch crash in Python 3
- Add non-ascii-entity-hiding.patch to workaround failure
  to properly parse non-ASCII based encodings on Python 3.5+
- Add py37.patch to fix parsing crash on Python 3.7

OBS-URL: https://build.opensuse.org/request/show/690091
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-feedparser?expand=0&rev=40
2019-04-01 09:04:03 +00:00

17 lines
680 B
Diff

diff -ur feedparser-5.2.1-orig/feedparser/feedparser.py feedparser-5.2.1/feedparser/feedparser.py
--- feedparser-5.2.1-orig/feedparser/feedparser.py 2015-07-24 12:00:04.000000000 +0700
+++ feedparser-5.2.1/feedparser/feedparser.py 2019-03-31 02:26:41.242238792 +0700
@@ -3764,7 +3764,11 @@
latlons = itertools.imap(float, value.strip().replace(',', ' ').split())
nxt = latlons.next
while True:
- t = [nxt(), nxt()][::swap and -1 or 1]
+ # Python 3.7 support
+ try:
+ t = [nxt(), nxt()][::swap and -1 or 1]
+ except StopIteration:
+ return
if dims == 3:
t.append(nxt())
yield tuple(t)