diff --git a/frappe/__init__.py b/frappe/__init__.py index dda36cf3d91..668245858c9 100644 --- a/frappe/__init__.py +++ b/frappe/__init__.py @@ -2427,8 +2427,8 @@ def _register_fault_handler(): import sys # Some libraries monkey patch stderr, we need actual fd - if isinstance(sys.stderr, io.TextIOWrapper): - faulthandler.register(signal.SIGUSR1, file=sys.stderr) + if isinstance(sys.__stderr__, io.TextIOWrapper): + faulthandler.register(signal.SIGUSR1, file=sys.__stderr__) if _tune_gc: