added keyboard interrupt exception for urllib

This commit is contained in:
TrustedSec 2016-07-24 18:21:51 -04:00
parent 8e321385e7
commit 3cda1d3117
2 changed files with 8 additions and 5 deletions

View file

@ -20,6 +20,7 @@ version 7.3
* added timeout delay for pulling new version biggest challenge here is that urllib base is socket and socket timeout is tied to gethostbyname() which does not support a timeout, needed to add multiprocessing poll for 8 seconds to add timeout delay when checking for updates
* added check for urllib for python2 and python3 compatibility
* changed delldrac to python 2 to 3 compatibility and rewrote requests to use solid urlopen instead of requests
* added keyboard exception handling for urllib pull for version
~~~~~~~~~~~~~~~~
version 7.2.3

View file

@ -837,11 +837,13 @@ def show_banner(define_version, graphic):
version = ""
def pull_version():
if not os.path.isfile(setdir + "/version.lock"):
url = ('https://raw.githubusercontent.com/trustedsec/social-engineer-toolkit/master/src/core/set.version')
version = urlopen(url).read().rstrip().decode('utf-8')
filewrite = open(setdir + "/version.lock", "w")
filewrite.write(version)
filewrite.close()
try:
url = ('https://raw.githubusercontent.com/trustedsec/social-engineer-toolkit/master/src/core/set.version')
version = urlopen(url).read().rstrip().decode('utf-8')
filewrite = open(setdir + "/version.lock", "w")
filewrite.write(version)
filewrite.close()
except KeyboardInterrupt: version = "keyboard interrupt"
else: version = open(setdir + "/version.lock", "r").read()