Skip to content

Commit 68ee314

Browse files
authored
Merge pull request #112 from yilei/remove-traceback
Proposal: Drop the traceback from the module-level backend error objects.
2 parents 230f8cf + 2f08550 commit 68ee314

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pathspec/_backends/hyperscan/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
hyperscan_error = None
1616
except ModuleNotFoundError as e:
1717
hyperscan = None
18-
hyperscan_error = e
18+
hyperscan_error = e.with_traceback(None)
1919

2020
hyperscan_error: Optional[ModuleNotFoundError]
2121
"""

pathspec/_backends/re2/_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
re2_error = None
1919
except ModuleNotFoundError as e:
2020
re2 = None
21-
re2_error = e
21+
re2_error = e.with_traceback(None)
2222
RE2_OPTIONS = None
2323
else:
2424
# Both the `google-re2` and `pyre2` libraries use the `re2` namespace.
@@ -28,7 +28,7 @@
2828
RE2_OPTIONS.log_errors = False
2929
RE2_OPTIONS.never_capture = True
3030
except Exception as e:
31-
re2_error = e
31+
re2_error = e.with_traceback(None)
3232
RE2_OPTIONS = None
3333

3434
RE2_OPTIONS: re2.Options

0 commit comments

Comments
 (0)