Skip to content

Commit

Permalink
Merge pull request #4 from offscale/switching-if
Browse files Browse the repository at this point in the history
Fix to_code: Swap behavior based on PY_GTE_3_9
  • Loading branch information
SamuelMarks authored Feb 14, 2023
2 parents 62fcd20 + 96af7d6 commit fec1e5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cdd/shared/ast_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1356,9 +1356,9 @@ def _to_code(node):
"""

return (
getattr(import_module("astor"), "to_source")
getattr(import_module("ast"), "unparse")
if PY_GTE_3_9
else getattr(import_module("ast"), "unparse")
else getattr(import_module("astor"), "to_source")
)(node)


Expand Down

0 comments on commit fec1e5c

Please sign in to comment.