summaryrefslogtreecommitdiffstats
path: root/pre_commit/envcontext.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-04-04 18:42:11 +0000
commit361ff4da262b4891323287049e9e6c5fbe1d01dc (patch)
tree969b376a2c170841758d39ef9516dac65c8b94cd /pre_commit/envcontext.py
parentAdding upstream version 2.17.0. (diff)
downloadpre-commit-361ff4da262b4891323287049e9e6c5fbe1d01dc.tar.xz
pre-commit-361ff4da262b4891323287049e9e6c5fbe1d01dc.zip
Adding upstream version 2.18.1.upstream/2.18.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/envcontext.py')
-rw-r--r--pre_commit/envcontext.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pre_commit/envcontext.py b/pre_commit/envcontext.py
index 92d975d..4f59560 100644
--- a/pre_commit/envcontext.py
+++ b/pre_commit/envcontext.py
@@ -1,10 +1,11 @@
+from __future__ import annotations
+
import contextlib
import enum
import os
from typing import Generator
from typing import MutableMapping
from typing import NamedTuple
-from typing import Optional
from typing import Tuple
from typing import Union
@@ -32,7 +33,7 @@ def format_env(parts: SubstitutionT, env: MutableMapping[str, str]) -> str:
@contextlib.contextmanager
def envcontext(
patch: PatchesT,
- _env: Optional[MutableMapping[str, str]] = None,
+ _env: MutableMapping[str, str] | None = None,
) -> Generator[None, None, None]:
"""In this context, `os.environ` is modified according to `patch`.