Browse files

check ssl and hashlib module #83

  • Loading branch information...
1 parent aace19a commit 3beb707bc9cf57a87d41a769eca368f90c94ff13 @fffonion committed Dec 14, 2016
Showing with 7 additions and 2 deletions.
  1. +7 −2
@@ -5,11 +5,16 @@
import sys
import json
import time
-import hashlib
import binascii
import tarfile
-import ssl
import atexit
+ import ssl
+ import hashlib
+except ImportError as ex:
+ print("Error: cannot import module ssl or hashlib (%s)." % str(ex))
+ print("If you are using openwrt, run \"opkg install python-openssl\"")
+ os._exit(0)
#xunlei use self-signed certificate; on py2.7.9+
if hasattr(ssl, '_create_unverified_context') and hasattr(ssl, '_create_default_https_context'):

0 comments on commit 3beb707

Please sign in to comment.