diff options
| author | LaMont Jones <lamontjones@google.com> | 2022-10-25 22:38:07 +0000 |
|---|---|---|
| committer | LaMont Jones <lamontjones@google.com> | 2022-10-25 22:46:47 +0000 |
| commit | 78dcd3799b50fd512f83e27cfad31bd0d6139ba4 (patch) | |
| tree | d71888796465d845807ab2cfaba22a2391324856 | |
| parent | acc4c857a0b6e2e33e3647028cbd312498fd5900 (diff) | |
| download | git-repo-78dcd3799b50fd512f83e27cfad31bd0d6139ba4.tar.gz | |
sync: do not require python 3.9v2.29.4
Use pre-3.9 syntax for NamedTuple, so that users do not need to have
python 3.9 or later installed.
Bug: b/255632143, crbug.com/gerrit/16355
Test: manually verified with python 3.8
Change-Id: I488d2d5267ed98d5c55c233cc789e629f1911c9d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/349395
Tested-by: LaMont Jones <lamontjones@google.com>
Reviewed-by: Jonathan Nieder <jrn@google.com>
| -rw-r--r-- | subcmds/sync.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 5818b458..8dc22141 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
| @@ -26,7 +26,7 @@ import socket | |||
| 26 | import sys | 26 | import sys |
| 27 | import tempfile | 27 | import tempfile |
| 28 | import time | 28 | import time |
| 29 | from typing import NamedTuple | 29 | from typing import NamedTuple, List, Set |
| 30 | import urllib.error | 30 | import urllib.error |
| 31 | import urllib.parse | 31 | import urllib.parse |
| 32 | import urllib.request | 32 | import urllib.request |
| @@ -94,19 +94,19 @@ class _FetchResult(NamedTuple): | |||
| 94 | 94 | ||
| 95 | Attributes: | 95 | Attributes: |
| 96 | success (bool): True if successful. | 96 | success (bool): True if successful. |
| 97 | projects (set[str]): The names of the git directories of fetched projects. | 97 | projects (Set[str]): The names of the git directories of fetched projects. |
| 98 | """ | 98 | """ |
| 99 | success: bool | 99 | success: bool |
| 100 | projects: set[str] | 100 | projects: Set[str] |
| 101 | 101 | ||
| 102 | 102 | ||
| 103 | class _FetchMainResult(NamedTuple): | 103 | class _FetchMainResult(NamedTuple): |
| 104 | """_FetchMain return value. | 104 | """_FetchMain return value. |
| 105 | 105 | ||
| 106 | Attributes: | 106 | Attributes: |
| 107 | all_projects (list[Project]): The fetched projects. | 107 | all_projects (List[Project]): The fetched projects. |
| 108 | """ | 108 | """ |
| 109 | all_projects: list[Project] | 109 | all_projects: List[Project] |
| 110 | 110 | ||
| 111 | 111 | ||
| 112 | class _CheckoutOneResult(NamedTuple): | 112 | class _CheckoutOneResult(NamedTuple): |
