Skip to content

Commit

Permalink
Fix Python 3.5 Travis test failures.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 317925038
  • Loading branch information
rchen152 committed Jun 23, 2020
1 parent 274cb27 commit a26daae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pytype/tools/xref/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def process_import(self, node):
# If an import is aliased, match() returns only the symbol/loc of
# the alias, whereas the indexer also needs access to the unaliased
# name in order to reference the imported module.
defn: Optional[Definition] = None
defn = None # type: Optional[Definition]
if alias.asname:
defn = self.add_local_def(
node, name=symbol, target=alias.name, data=data)
Expand Down
3 changes: 2 additions & 1 deletion pytype/tools/xref/indexer_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def assertAlias(self, index, fqname, target):
self.assertIn(fqname, index.aliases)
alias = index.aliases[fqname]
self.assertIsInstance(alias, indexer.Remote)
self.assertEqual(f"{alias.module}.{alias.name}", target)
self.assertEqual(
"{module}.{name}".format(module=alias.module, name=alias.name), target)

def assertDef(self, index, fqname, name, typ):
self.assertIn(fqname, index.defs)
Expand Down

0 comments on commit a26daae

Please sign in to comment.