Skip to content

Commit

Permalink
Fix error in make_tutorials.py (#2066)
Browse files Browse the repository at this point in the history
Summary:
If `env` is `None` then this raises a `'NoneType' object has no attribute 'items'` error. This change fixes this issue and simplifies the setup.

Pull Request resolved: #2066

Reviewed By: mgarrard

Differential Revision: D52007186

Pulled By: Balandat

fbshipit-source-id: 7744a7391381fe6a298d7c7d43bb5d42c982dd28
  • Loading branch information
Balandat authored and facebook-github-bot committed Dec 9, 2023
1 parent afae7f0 commit 35ec389
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions scripts/make_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ def run_script(
tutorial: Path, timeout_minutes: int, env: Optional[Dict[str, str]] = None
) -> None:
if env is not None:
env = {**os.environ, **env}
for k, v in env.items():
os.environ[k] = v
os.environ.update(env)
papermill.execute_notebook(
tutorial,
tutorial,
Expand Down

0 comments on commit 35ec389

Please sign in to comment.