Handle failure to import the ast module

This commit is contained in:
Alex Willmer 2017-09-21 22:12:07 +01:00 committed by David Wilson
parent dd8271f061
commit aa817f1b83
1 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,9 @@
import ast
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