Simple try/except import trick
This commit is contained in:
parent
830774824e
commit
92b3cf41bc
@ -44,13 +44,10 @@ from . import config, log
|
||||
# pylint: disable=F0401
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
from io import StringIO
|
||||
except ImportError:
|
||||
from ConfigParser import ConfigParser
|
||||
|
||||
try:
|
||||
from StringIO import StringIO
|
||||
except ImportError:
|
||||
from io import StringIO
|
||||
# pylint: enable=F0401
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user