Fix set type hint for older Python versions

This commit is contained in:
Carlos Nihelton 2022-05-10 09:31:22 -03:00
parent 0dba0722ab
commit f9d2d3100e
No known key found for this signature in database
GPG Key ID: 6FE346D245197E9A
1 changed files with 2 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import attr
import pwd import pwd
import os import os
import re import re
from typing import Set
from subiquitycore.context import with_context from subiquitycore.context import with_context
@ -33,7 +34,7 @@ USERNAME_MAXLEN = 32
USERNAME_REGEX = r'[a-z_][a-z0-9_-]*' USERNAME_REGEX = r'[a-z_][a-z0-9_-]*'
def _reserved_names_from_file(path: str) -> set[str]: def _reserved_names_from_file(path: str) -> Set[str]:
if os.path.exists(path): if os.path.exists(path):
with open(path, "r") as f: with open(path, "r") as f:
return { return {