Only import compiler when necessary, it's not available in 3.x.
This commit is contained in:
parent
aa817f1b83
commit
8054fa867a
|
@ -1,11 +1,4 @@
|
|||
try:
|
||||
import ast
|
||||
except ImportError:
|
||||
# ast module is not available in Python 2.4.x, instead we shall use the
|
||||
# the compiler module as a fallback
|
||||
ast = None
|
||||
import commands
|
||||
import compiler
|
||||
import errno
|
||||
import getpass
|
||||
import imp
|
||||
|
@ -27,6 +20,14 @@ import time
|
|||
import types
|
||||
import zlib
|
||||
|
||||
try:
|
||||
import ast
|
||||
except ImportError:
|
||||
# ast module is not available in Python 2.4.x, instead we shall use the the
|
||||
# compiler module as a fallback
|
||||
ast = None
|
||||
import compiler
|
||||
|
||||
if not hasattr(pkgutil, 'find_loader'):
|
||||
# find_loader() was new in >=2.5, but the modern pkgutil.py syntax has
|
||||
# been kept intentionally 2.3 compatible so we can reuse it.
|
||||
|
|
Loading…
Reference in New Issue