Skip to content

Commit

Permalink
wrap whole of gui_github_versioninfo in try
Browse files Browse the repository at this point in the history
* note this is failing in jython 2.7b1
  see http://bugs.jython.org/issue2022
* so in catch 22 with python 2.5.3 bug
  http://bugs.jython.org/issue1885
  • Loading branch information
jefferis committed Apr 16, 2015
1 parent 8bb3ee2 commit 307b17a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cmtkgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,16 +253,17 @@ def gui_github_versioninfo():
Create a dictionary containing version information for current
github code
'''
try: u = urllib2.urlopen(gui_tarball_url)
try:
u = urllib2.urlopen(gui_tarball_url)
headers = u.info()
date = headers['date']
size = int(headers['Content-Length'])
filename = re.sub(".*filename=","",headers['Content-Disposition'])
u.close()
abbrev_sha1 = re.sub(".*-([a-f0-9]+).tar.gz","\\1",filename)
return {'abbrev_sha1':abbrev_sha1, 'filename':filename, 'date':date, 'size':size}
except IOError, e:
myErr("Unable to read github repository")
headers = u.info()
date = headers['date']
size = int(headers['Content-Length'])
filename = re.sub(".*filename=","",headers['Content-Disposition'])
u.close()
abbrev_sha1 = re.sub(".*-([a-f0-9]+).tar.gz","\\1",filename)
return {'abbrev_sha1':abbrev_sha1, 'filename':filename, 'date':date, 'size':size}

def gui_local_versioninfo():
'''
Expand Down

0 comments on commit 307b17a

Please sign in to comment.