Skip to content

Commit

Permalink
fix some typing
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Nov 4, 2024
1 parent 850e8e9 commit c82a18a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/python/pyflyby/_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ def _ast_node_is_in_docstring_position(ast_node):
return False


def infer_compile_mode(arg):
def infer_compile_mode(arg:str.AST) -> str:
"""
Infer the mode needed to compile ``arg``.
Expand Down Expand Up @@ -1194,9 +1194,9 @@ def compile(self, mode: Optional[str] = None):
``CodeType``
"""
ast_node = self.parse(mode=mode)
mode = infer_compile_mode(ast_node)
c_mode = infer_compile_mode(ast_node)
filename = str(self.filename or "<unknown>")
return compile(ast_node, filename, mode)
return compile(ast_node, filename, c_mode)

@cached_property
def statements(self) -> Tuple[PythonStatement, ...]:
Expand Down

0 comments on commit c82a18a

Please sign in to comment.