try/except import are now handled by flake8 2.0+ / pyflakes 0.6+

This commit is contained in:
Laurent Bachelier 2013-03-18 21:15:44 +01:00 committed by Florent
commit be3e19a203
14 changed files with 17 additions and 17 deletions

View file

@ -21,7 +21,7 @@
try: try:
import sqlite3 as sqlite import sqlite3 as sqlite
except ImportError, e: except ImportError, e:
from pysqlite2 import dbapi2 as sqlite # NOQA from pysqlite2 import dbapi2 as sqlite
from weboob.core import Weboob from weboob.core import Weboob
from weboob.core.modules import ModuleLoadError from weboob.core.modules import ModuleLoadError

View file

@ -25,7 +25,7 @@ from logging import warning, debug
try: try:
from urlparse import parse_qs from urlparse import parse_qs
except ImportError: except ImportError:
from cgi import parse_qs # NOQA from cgi import parse_qs
from weboob.tools.misc import html2text, get_bytes_size from weboob.tools.misc import html2text, get_bytes_size
from weboob.capabilities.torrent import Torrent from weboob.capabilities.torrent import Torrent

View file

@ -23,7 +23,7 @@ import re
try: try:
from urlparse import parse_qs from urlparse import parse_qs
except ImportError: except ImportError:
from cgi import parse_qs # NOQA from cgi import parse_qs
from weboob.capabilities import NotAvailable from weboob.capabilities import NotAvailable
from weboob.tools.browser import BasePage, BrokenPageError from weboob.tools.browser import BasePage, BrokenPageError

View file

@ -21,7 +21,7 @@
try: try:
from urlparse import parse_qs from urlparse import parse_qs
except ImportError: except ImportError:
from cgi import parse_qs # NOQA from cgi import parse_qs
from urlparse import urlsplit from urlparse import urlsplit

View file

@ -29,7 +29,7 @@ import re
try: try:
from urlparse import parse_qs from urlparse import parse_qs
except ImportError: except ImportError:
from cgi import parse_qs # NOQA from cgi import parse_qs
__all__ = ['RadioFranceBrowser', 'RadioFranceVideo'] __all__ = ['RadioFranceBrowser', 'RadioFranceVideo']

View file

@ -43,7 +43,7 @@ try:
import conic import conic
except ImportError: except ImportError:
warning("conic is not found") warning("conic is not found")
conic = FakeConic() # NOQA conic = FakeConic()
from logging import debug from logging import debug

View file

@ -32,7 +32,7 @@ try:
except ImportError: except ImportError:
PROMPT = '--Press return to continue--' PROMPT = '--Press return to continue--'
def readch(): # NOQA def readch():
return sys.stdin.readline() return sys.stdin.readline()
else: else:
PROMPT = '--Press a key to continue--' PROMPT = '--Press a key to continue--'

View file

@ -21,7 +21,7 @@
try: try:
import sqlite3 as sqlite import sqlite3 as sqlite
except ImportError, e: except ImportError, e:
from pysqlite2 import dbapi2 as sqlite # NOQA from pysqlite2 import dbapi2 as sqlite
from mechanize import CookieJar, Cookie from mechanize import CookieJar, Cookie

View file

@ -29,8 +29,8 @@ try:
from yaml import CLoader as Loader from yaml import CLoader as Loader
from yaml import CDumper as Dumper from yaml import CDumper as Dumper
except ImportError: except ImportError:
from yaml import Loader # NOQA from yaml import Loader
from yaml import Dumper # NOQA from yaml import Dumper
from .iconfig import IConfig, ConfigError from .iconfig import IConfig, ConfigError

View file

@ -27,4 +27,4 @@ try:
import simplejson as json import simplejson as json
except ImportError: except ImportError:
# Python 2.6+ has a module similar to simplejson # Python 2.6+ has a module similar to simplejson
import json # NOQA import json

View file

@ -22,15 +22,15 @@ try:
from collections import OrderedDict from collections import OrderedDict
except ImportError: except ImportError:
try: try:
from simplejson import OrderedDict # NOQA from simplejson import OrderedDict
except ImportError: except ImportError:
try: try:
from ordereddict import OrderedDict # NOQA from ordereddict import OrderedDict
except ImportError: except ImportError:
## {{{ http://code.activestate.com/recipes/576693/ (r6) ## {{{ http://code.activestate.com/recipes/576693/ (r6)
from UserDict import DictMixin from UserDict import DictMixin
class OrderedDict(dict, DictMixin): # NOQA class OrderedDict(dict, DictMixin):
def __init__(self, *args, **kwds): def __init__(self, *args, **kwds):
if len(args) > 1: if len(args) > 1:
raise TypeError('expected at most 1 arguments, got %d' % len(args)) raise TypeError('expected at most 1 arguments, got %d' % len(args))

View file

@ -30,7 +30,7 @@ from elementtidy import TidyHTMLTreeBuilder
try: try:
from xml.etree import cElementTree as ElementTree from xml.etree import cElementTree as ElementTree
except ImportError: except ImportError:
from xml.etree import ElementTree # NOQA from xml.etree import ElementTree
from .iparser import IParser from .iparser import IParser

View file

@ -22,7 +22,7 @@ from html5lib import treebuilders, HTMLParser
try: try:
from xml.etree import cElementTree as ElementTree from xml.etree import cElementTree as ElementTree
except ImportError: except ImportError:
from xml.etree import ElementTree # NOQA from xml.etree import ElementTree
from .iparser import IParser from .iparser import IParser

View file

@ -23,7 +23,7 @@ import htmlentitydefs
try: try:
from xml.etree import cElementTree as ElementTree from xml.etree import cElementTree as ElementTree
except ImportError: except ImportError:
from xml.etree import ElementTree # NOQA from xml.etree import ElementTree
from .iparser import IParser from .iparser import IParser