def visit_Import(self, node): pat = P.Import([P.alias("incoq.runtime", P.PatVar("_ALIAS"))]) match = P.match(pat, node) if match is None: return node # Remove the import. Record the alias to remove its uses. if match["_ALIAS"] is not None: qual = P.Name(match["_ALIAS"], P.Load()) self.quals.add(qual) return []
def visit_Import(self, node): pat = P.Import([P.alias('incoq.runtime', P.PatVar('_ALIAS'))]) match = P.match(pat, node) if match is None: return node # Remove the import. Record the alias to remove its uses. if match['_ALIAS'] is not None: qual = P.Name(match['_ALIAS'], P.Load()) self.quals.add(qual) return []