Skip to content

Commit

Permalink
fix some ufmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
martindemello committed Jan 7, 2022
1 parent d2429cf commit 79d7acd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions libcst/_parser/parso/python/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class PythonTokenTypes:
ERRORTOKEN: TokenType = native_token_type.ERRORTOKEN
ERROR_DEDENT: TokenType = native_token_type.ERROR_DEDENT


except ImportError:
from libcst._parser.parso.python.py_token import ( # noqa F401
PythonTokenTypes,
Expand Down
8 changes: 6 additions & 2 deletions libcst/codemod/visitors/_add_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ def __init__(
module: {
imp.obj_name
for imp in imps
if imp.module == module and imp.obj_name is not None and imp.alias is None
if imp.module == module
and imp.obj_name is not None
and imp.alias is None
}
for module in sorted(from_imports)
}
Expand All @@ -151,7 +153,9 @@ def __init__(
}
# List of modules we need to check for object imports on
from_imports_aliases: Set[str] = {
imp.module for imp in imps if imp.obj_name is not None and imp.alias is not None
imp.module
for imp in imps
if imp.obj_name is not None and imp.alias is not None
}
# Mapping of modules we're adding to the object with alias they should import
self.alias_mapping: Dict[str, List[Tuple[str, str]]] = {
Expand Down

0 comments on commit 79d7acd

Please sign in to comment.