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
|
# pylint: disable=F0401
|
||||||
try:
|
try:
|
||||||
from configparser import ConfigParser
|
from configparser import ConfigParser
|
||||||
|
from io import StringIO
|
||||||
except ImportError:
|
except ImportError:
|
||||||
from ConfigParser import ConfigParser
|
from ConfigParser import ConfigParser
|
||||||
|
|
||||||
try:
|
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
except ImportError:
|
|
||||||
from io import StringIO
|
|
||||||
# pylint: enable=F0401
|
# pylint: enable=F0401
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user