Skip to content

Commit

Permalink
Python 2.6 compatibility fix
Browse files Browse the repository at this point in the history
Signed-off-by: Jim Easterbrook <jim@jim-easterbrook.me.uk>
  • Loading branch information
jim-easterbrook committed Feb 23, 2016
1 parent 7e4ae90 commit 6d4c346
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/pywws/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
__version__ = '15.12.0.dev1342'
_release = '1342'
_commit = 'b1fdc2f'
__version__ = '16.02.0.dev1343'
_release = '1343'
_commit = '7e4ae90'
5 changes: 4 additions & 1 deletion src/pywws/toservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,10 @@ def http_send_data(self, timestamp, prepared_data, ignore_last_update=False):
return True
return False
except urllib2.HTTPError, ex:
new_ex = '[%d]%s' % (ex.code, ex.reason)
if sys.version_info >= (2, 7):
new_ex = '[%d]%s' % (ex.code, ex.reason)
else:
new_ex = str(ex)
ex_info = str(ex.info()).split('\n')
try:
for line in ex.readlines():
Expand Down

0 comments on commit 6d4c346

Please sign in to comment.