Feature/windows (#441)

* new: dev: windows only package

* chg: dev: catch ModuleNotFoundError on python3.6+

* chg: dev: use general exception
This commit is contained in:
rachmadani haryono 2020-04-05 09:37:25 +08:00 committed by GitHub
parent 11b869842f
commit 9fce289d6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

12
buku
View File

@ -39,15 +39,17 @@ import threading
import time import time
from typing import Any, Dict, Iterable, List, Optional, Tuple from typing import Any, Dict, Iterable, List, Optional, Tuple
import webbrowser import webbrowser
try:
import readline
except ImportError:
import pyreadline as readline # type: ignore
from bs4 import BeautifulSoup
import certifi import certifi
import urllib3 import urllib3
from urllib3.exceptions import LocationParseError from urllib3.exceptions import LocationParseError
from urllib3.util import parse_url, make_headers from urllib3.util import parse_url, make_headers
from bs4 import BeautifulSoup
# note catch ModuleNotFoundError instead Exception
# when python3.5 not supported
try:
import readline
except Exception:
import pyreadline as readline # type: ignore
try: try:
from mypy_extensions import TypedDict from mypy_extensions import TypedDict
except ImportError: except ImportError:

View File

@ -5,3 +5,4 @@ cryptography>=1.2.3
html5lib>=1.0.1 html5lib>=1.0.1
setuptools setuptools
urllib3>=1.23 urllib3>=1.23
pyreadline; sys_platform == 'windows'