zubin71  committed 11bf811

compiler module replaced with the ast module.

  • Participants
  • Parent commits 54e944b

Comments (0)

Files changed (1)


 # Comments, suggestions and bug reports welcome.
+import pdb
 import os
 import re
 from codecs import BOM_UTF8, BOM_UTF16, BOM_UTF16_BE, BOM_UTF16_LE
 # imported lazily to avoid startup performance hit if it isn't used
-compiler = None
+ast = None
 # A dictionary mapping BOM to
 # the encoding to decode with, and what to set the
 def getObj(s):
-    global compiler
-    if compiler is None:
-        import compiler
+    global ast
+    if ast is None:
+        import ast
     s = "a=" + s
-    p = compiler.parse(s)
+    p = ast.parse(s)
     return p.getChildren()[1].getChildren()[0].getChildren()[1]
 class UnknownType(Exception):
 class Builder(object):
     def build(self, o):
         m = getattr(self, 'build_' + o.__class__.__name__, None)
         if m is None:
             raise UnknownType(o.__class__.__name__)
             infile = [line.rstrip('\r\n') for line in infile]
         # if we had any errors, now is the time to raise them
     def _parse(self, infile):
         """Actually parse the config file."""
+        print("entering _parse for parsing infile")
         temp_list_values = self.list_values
         if self.unrepr:
             self.list_values = False