From a23ca95173b3b207bc915450981b8be42705fb4e Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 7 Feb 2019 16:26:12 +0100 Subject: [PATCH 1/2] Revert "Remove typing from requirements" This reverts commit 7b12b1a2 --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 955ee53d..227aacf6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ pyaes==1.6.1 -pysocks==1.6.8 \ No newline at end of file +pysocks==1.6.8 +typing==3.6.6; python_version<"3.5" \ No newline at end of file From c05e0086566e1fba856bc882d1320d7c6aa90f0f Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Thu, 7 Feb 2019 16:27:17 +0100 Subject: [PATCH 2/2] Monkey patch "typing" only for Python 3.5.0, 3.5.1 and 3.5.2 --- pyrogram/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index d3fef004..e931fd70 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -18,10 +18,11 @@ import sys -from .vendor import typing +if sys.version_info[:3] in [(3, 5, 0), (3, 5, 1), (3, 5, 2)]: + from .vendor import typing -# Monkey patch the standard "typing" module because Python versions from 3.5.0 to 3.5.2 have a broken one. -sys.modules["typing"] = typing + # Monkey patch the standard "typing" module because Python versions from 3.5.0 to 3.5.2 have a broken one. + sys.modules["typing"] = typing __copyright__ = "Copyright (C) 2017-2019 Dan Tès ".replace( "\xe8",