Skip to content

Commit

Permalink
Add requirements.txt, Add ValueError exception to catch DNS failures …
Browse files Browse the repository at this point in the history
…in check_version
  • Loading branch information
Iterniam committed Aug 12, 2021
1 parent 4b0d2a4 commit 48d688f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import colorama


VERSION = "v2.3"
VERSION = "v2.3.1"
follow_mode = False # False -> analyze mode

dt_dict = {
Expand Down Expand Up @@ -476,7 +476,8 @@ def check_version():
f'To download the new update, visit https://github.com/revoltage34/ptanalyzer/releases/latest.')
else:
print(f'{fg.li_grey}Version is up-to-date. ')
except (requests.exceptions.RequestException, KeyError): # Internet down, slow or unexpected Github response.
except (requests.exceptions.RequestException, KeyError, ValueError):
# Possible errors are: Internet down, slow or unexpected Github response, or a failed DNS lookup.
print(f'{fg.red}Unable to connect to Github to check for new versions. Continuing...')
return

Expand Down
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
packaging
requests
colorama
sty

0 comments on commit 48d688f

Please sign in to comment.