From: Nikita Shulga Date: Mon, 30 Aug 2021 20:26:00 +0000 (-0700) Subject: Fix type annotation in tools/nightly.py (#64202) X-Git-Tag: accepted/tizen/8.0/unified/20231005.095509~588 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b9933f08b985f9105e00804d5c99016841bd4cc7;p=platform%2Fupstream%2Fpytorch.git Fix type annotation in tools/nightly.py (#64202) Summary: `tempfile.TemporaryDirectory` is a generic only in python-3.9 and above Workaround by wrapping type annotation in quotes Fixes https://github.com/pytorch/pytorch/issues/64017 Pull Request resolved: https://github.com/pytorch/pytorch/pull/64202 Reviewed By: janeyx99 Differential Revision: D30644215 Pulled By: malfet fbshipit-source-id: 3c16240b9fa899bd4d572c1732a7d87d3dd0fbd5 --- diff --git a/tools/nightly.py b/tools/nightly.py index 0b387e3..7a46a01 100755 --- a/tools/nightly.py +++ b/tools/nightly.py @@ -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]