Skip to content

Commit

Permalink
improve PY2/3 imports and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
MestreLion committed Feb 20, 2018
1 parent d145fcf commit a341230
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
15 changes: 7 additions & 8 deletions httpbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@
import hashlib

if sys.version_info.major < 3:
import urllib2
import urlparse
import urllib2 # @UnresolvedImport
import urlparse # @UnresolvedImport
else:
urllib2 = urllib.request
urlparse = urllib.parse
urllib2 = urllib.request # @UndefinedVariable
urlparse = urllib.parse # @UndefinedVariable

# Debian/Ubuntu: python-lxml
from lxml import html

from lxml import html # Debian/Ubuntu: python-lxml
try:
# Debian/Ubuntu: python-progressbar
import progressbar
import progressbar # Debian/Ubuntu: python-progressbar
except ImportError:
progressbar = None

Expand Down
13 changes: 7 additions & 6 deletions humblebundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,26 @@
import shlex
import shutil

if sys.version_info.major < 3:
try:
import cookielib
from urlparse import urljoin, urlsplit, parse_qs
import Queue
else:
except ImportError: # Python 3
import http.cookiejar as cookielib
from urllib.parse import urljoin, urlsplit, parse_qs
import queue as Queue

# Debian/Ubuntu: python-xdg
import xdg.BaseDirectory as xdg

import xdg.BaseDirectory as xdg # Debian/Ubuntu: python-xdg
try:
# Debian/Ubuntu: python-keyring
import keyring
import keyring # Debian/Ubuntu: python-keyring
except ImportError:
keyring = None


import httpbot


log = logging.getLogger(__name__)


Expand Down

0 comments on commit a341230

Please sign in to comment.