Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

in a finally to close a urllib.urlopen'ed file, check to make sure th…

…e file object is not None.
  • Loading branch information...
commit 9c9cc13273652cf39bc2b17e7c86d9f93151c780 1 parent 9ebc56d
Jeremy Hoon authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  updatemanager.py
View
3  updatemanager.py
@@ -64,7 +64,8 @@ def github_last_commit(sUser,sRepo,sBranch):
infile = urllib.urlopen(sUrl)
dictJson = json.load(infile)
finally:
- infile.close()
+ if infile is not None:
+ infile.close()
listCommit = map(Commit.from_json, dictJson["commits"])
listCommit.sort(lambda a,b: -cmp(a.dt,b.dt))
return (listCommit and listCommit[0]) or None
Please sign in to comment.
Something went wrong with that request. Please try again.