Skip to content

Commit

Permalink
adapt sys.version_info for Python < 2.7; fixes #3
Browse files Browse the repository at this point in the history
  • Loading branch information
bast committed Jun 22, 2015
1 parent 8c38f35 commit 9c65de9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions update.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@
import shutil
from collections import OrderedDict

if sys.version_info.major > 2:
# we do not use the nicer sys.version_info.major
# for compatibility with Python < 2.7
if sys.version_info[0] > 2:
from configparser import RawConfigParser
else:
from ConfigParser import RawConfigParser

if sys.version_info.major > 2:
if sys.version_info[0] > 2:
import urllib.request
class URLopener(urllib.request.FancyURLopener):
def http_error_default(self, url, fp, errcode, errmsg, headers):
Expand Down

0 comments on commit 9c65de9

Please sign in to comment.