Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #266 from Didey/patch-1
Browse files Browse the repository at this point in the history
Update to update code.
  • Loading branch information
DeeJayhX authored Apr 24, 2017
2 parents d9b93a5 + 1249db5 commit b3b7bd5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions dwt_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,16 @@ def __init__(self, parent):


def update_check(parent):
r = urllib2.urlopen('https://api.github.com/repos/10se1ucgo/DisableWinTracking/releases/latest')
try:
r = urllib2.urlopen('https://api.github.com/repos/10se1ucgo/DisableWinTracking/releases/latest')
except URLError:

This comment has been minimized.

Copy link
@10se1ucgo

10se1ucgo Apr 27, 2017

Owner

Does this even run? I'm pretty sure URLError isn't in the global scope

This comment has been minimized.

Copy link
@DeeJayhX

DeeJayhX Apr 28, 2017

Author Collaborator

Yes, it runs, URLError is a part of urllib2

This comment has been minimized.

Copy link
@10se1ucgo

10se1ucgo Apr 28, 2017

Owner

Wouldn't it need to be urllib2.URLError in that case?

This comment has been minimized.

Copy link
@DeeJayhX

DeeJayhX Apr 30, 2017

Author Collaborator

I believe it's implied, the difference between writing it out and not writing it out is 8 digits. I could be mistaken.

return
value, parameters = cgi.parse_header(r.headers.get('Content-Type', ''))
release = json.loads(r.read().decode(parameters.get('charset', 'utf-8')))
if release['prerelease']:
return
new = release['tag_name']

try:
if StrictVersion(__version__) < StrictVersion(new.lstrip('v')):
info = wx.MessageDialog(parent, message="DWT {v} is now available!\nGo to download page?".format(v=new),
Expand All @@ -182,4 +185,4 @@ def update_check(parent):
webbrowser.open_new_tab(release['html_url'])
info.Destroy()
except ValueError:
pass
return

This comment has been minimized.

Copy link
@10se1ucgo

10se1ucgo Apr 27, 2017

Owner

Unnecessary change, makes no difference

This comment has been minimized.

Copy link
@DeeJayhX

DeeJayhX Apr 30, 2017

Author Collaborator

It's a good habit to never use pass unless you absolutely need it anyways.

0 comments on commit b3b7bd5

Please sign in to comment.