Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
Fix type annotation in tools/nightly.py (pytorch#64202)
Browse files Browse the repository at this point in the history
Summary:
`tempfile.TemporaryDirectory` is a generic only in python-3.9 and above

Workaround by wrapping type annotation in quotes

Fixes pytorch#64017

Pull Request resolved: pytorch#64202

Reviewed By: janeyx99

Differential Revision: D30644215

Pulled By: malfet

fbshipit-source-id: 3c16240b9fa899bd4d572c1732a7d87d3dd0fbd5
  • Loading branch information
malfet authored and facebook-github-bot committed Aug 30, 2021
1 parent f3e329c commit b9933f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/nightly.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def deps_install(deps: List[str], existing_env: bool, env_opts: List[str]) -> No


@timed("Installing pytorch nightly binaries")
def pytorch_install(url: str) -> tempfile.TemporaryDirectory[str]:
def pytorch_install(url: str) -> "tempfile.TemporaryDirectory[str]":
""""Install pytorch into a temporary directory"""
pytdir = tempfile.TemporaryDirectory()
cmd = ["conda", "create", "--yes", "--no-deps", "--prefix", pytdir.name, url]
Expand Down

0 comments on commit b9933f0

Please sign in to comment.