diff options
Diffstat (limited to 'Lib/subprocess.py')
| -rw-r--r-- | Lib/subprocess.py | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 1eecceaed4..86fdf27f9b 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -52,6 +52,7 @@ import threading import warnings import contextlib from time import monotonic as _time +import types try: import pwd @@ -446,17 +447,7 @@ class CompletedProcess(object): args.append('stderr={!r}'.format(self.stderr)) return "{}({})".format(type(self).__name__, ', '.join(args)) - def __class_getitem__(cls, type): - """Provide minimal support for using this class as generic - (for example in type annotations). - - See PEP 484 and PEP 560 for more details. For example, - `CompletedProcess[bytes]` is a valid expression at runtime - (type argument `bytes` indicates the type used for stdout). - Note, no type checking happens at runtime, but a static type - checker can be used. - """ - return cls + __class_getitem__ = classmethod(types.GenericAlias) def check_returncode(self): @@ -1000,16 +991,7 @@ class Popen(object): obj_repr = obj_repr[:76] + "...>" return obj_repr - def __class_getitem__(cls, type): - """Provide minimal support for using this class as generic - (for example in type annotations). - - See PEP 484 and PEP 560 for more details. For example, `Popen[bytes]` - is a valid expression at runtime (type argument `bytes` indicates the - type used for stdout). Note, no type checking happens at runtime, but - a static type checker can be used. - """ - return cls + __class_getitem__ = classmethod(types.GenericAlias) @property def universal_newlines(self): |
