Skip to content

Commit

Permalink
eventstreams: stop checking requests version
Browse files Browse the repository at this point in the history
pywikibot requires requests>=2.21.0

Change-Id: I3525f7fee43280d5d45f86934229ec6e822b5692
  • Loading branch information
JJMC89 committed Dec 23, 2023
1 parent 5462114 commit 58164f4
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions pywikibot/comms/eventstreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import json
from functools import partial

from pkg_resources import parse_version
from requests import __version__ as requests_version
from requests.packages.urllib3.exceptions import ProtocolError
from requests.packages.urllib3.util.response import httplib

Expand All @@ -35,12 +33,6 @@
EventSource = e


if parse_version(requests_version) < parse_version('2.20.1'):
raise ImportError(
'requests >= 2.20.1 is required for EventStreams;\n'
"install it with 'pip install \"requests>=2.20.1\"'\n")


class EventStreams(GeneratorWrapper):

"""Generator class for Server-Sent Events (SSE) protocol.
Expand Down Expand Up @@ -142,8 +134,10 @@ def __init__(self, **kwargs) -> None:
parameter.
"""
if isinstance(EventSource, Exception):
raise ImportError('sseclient is required for EventStreams;\n'
'install it with "pip install sseclient"\n')
raise ImportError(
'sseclient is required for EventStreams;\n'
'install it with "pip install sseclient==0.0.22"\n'
)
self.filter = {'all': [], 'any': [], 'none': []}
self._total = None
self._canary = kwargs.pop('canary', False)
Expand Down

0 comments on commit 58164f4

Please sign in to comment.