Skip to content

Commit

Permalink
Skip black formatting if it encounters an AttributeError (#699)
Browse files Browse the repository at this point in the history
Fixes #698
  • Loading branch information
colindean authored Nov 1, 2023
1 parent d5a986c commit c40813a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions papermill/translators.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ def codify(cls, parameters, comment='Parameters'):
content = black.format_str(content, mode=fm)
except ImportError:
logger.debug("Black is not installed, parameters won't be formatted")
except AttributeError as aerr:
logger.warning(f"Black encountered an error, skipping formatting ({aerr})")
return content

@classmethod
Expand Down

0 comments on commit c40813a

Please sign in to comment.