From aa817f1b8307c9b8a81eea7a674f42b03390be88 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Thu, 21 Sep 2017 22:12:07 +0100 Subject: [PATCH] Handle failure to import the ast module --- mitogen/master.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mitogen/master.py b/mitogen/master.py index cdb4c321..288de77f 100644 --- a/mitogen/master.py +++ b/mitogen/master.py @@ -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