--- a/src/pytestshellutils/exceptions.py
+++ b/src/pytestshellutils/exceptions.py
@@ -3,6 +3,8 @@
"""
Pytest Shell Utilities related exceptions.
"""
+from __future__ import annotations
+
from typing import Optional
from pytestshellutils.utils.processes import ProcessResult
@@ -30,7 +32,7 @@ class ProcessFailed(ShellUtilsException):
The ``ProcessResult`` instance when the exception occurred
"""
- def __init__(self, message: str, process_result: Optional[ProcessResult] = None) -> None:
+ def __init__(self, message: str, process_result: ProcessResult | None = None) -> None:
super().__init__()
self.message = message
self.process_result = process_result
Traceback (most recent call last):
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/bin/downgrade-source", line 8, in <module>
sys.exit(main())
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/downgradesource/__main__.py", line 165, in main
exitcode = untype_source(
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/downgradesource/__main__.py", line 57, in untype_source
fixed_source_text = transpile.transpile_module(ctx, source_text)
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/lib3to6/transpile.py", line 290, in transpile_module
maybe_fixed_module = fixer(ctx, module_tree)
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/lib3to6/fixers.py", line 199, in __call__
_FRAFContext(local_classes).remove_forward_references(tree)
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/lib3to6/fixers.py", line 186, in remove_forward_references
self.remove_forward_references(sub_node)
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/lib3to6/fixers.py", line 184, in remove_forward_references
self.update_annotation_refs(sub_node, 'annotation')
File "/home/vampas/.cache/pre-commit/repolg5j4qb6/py_env-python3.8/lib/python3.8/site-packages/lib3to6/fixers.py", line 167, in update_annotation_refs
raise NotImplementedError(msg)
NotImplementedError: Error fixing annotation of forward ref with type <class '_ast.BinOp'>
Consider the following diff:
lib3to6will fail to downgrade the code and throws the following traceback