Skip to content

Commit

Permalink
fix gevent patch in py3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
soraxas committed May 29, 2020
1 parent 4706f78 commit a3a6753
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions echo360/hls_downloader.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
from gevent import monkey
monkey.patch_all()
from gevent.pool import Pool
import ffmpy
import gevent
import requests
Expand Down
4 changes: 4 additions & 0 deletions echo360/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ def cmd_exists(x):
course_url).group() # retrieve the last part of the URL
course = EchoCloudCourse(course_uuid, course_hostname)
else:
# import it here for monkey patching gevent, to fix the followings:
# MonkeyPatchWarning: Monkey-patching ssl after ssl has already been
# imported may lead to errors, including RecursionError on Python 3.6.
from . import hls_downloader
course_uuid = re.search('[^/]+(?=/$|$)',
course_url).group() # retrieve the last part of the URL
course = EchoCourse(course_uuid, course_hostname)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
platforms='linux, macos, windows',
entry_points={
'console_scripts': [
'echo360download=echo360.main:main',
'echo360-download=echo360.main:main',
],
},
package_data={'echo360': ['*.py']},
Expand Down

0 comments on commit a3a6753

Please sign in to comment.