From f09b48aaba099e28d6508892c1b42bffd8366103 Mon Sep 17 00:00:00 2001 From: Tian Gao Date: Tue, 30 Apr 2024 19:32:20 -0700 Subject: [PATCH] Make safepath work with 3.11- --- src/coredumpy/coredumpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/coredumpy/coredumpy.py b/src/coredumpy/coredumpy.py index 6478a3b..c538d7b 100644 --- a/src/coredumpy/coredumpy.py +++ b/src/coredumpy/coredumpy.py @@ -42,7 +42,7 @@ def __init__(self, target): # If safe_path(-P) is not set, sys.path[0] is the directory # of pdb, and we should replace it with the directory of the script - if not sys.flags.safe_path: + if not getattr(sys.flags, "safe_path", None): sys.path[0] = os.path.dirname(self._target) def __repr__(self):