From c19c6c324bbb03f055970113496753fed21b4f79 Mon Sep 17 00:00:00 2001 From: Disconnect3d Date: Mon, 8 May 2023 11:58:17 +0200 Subject: [PATCH] Fix enums from Python 3.11: use ReprEnum (#1700) --- pwndbg/heap/ptmalloc.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pwndbg/heap/ptmalloc.py b/pwndbg/heap/ptmalloc.py index 7f2556dbc..cad2cc388 100644 --- a/pwndbg/heap/ptmalloc.py +++ b/pwndbg/heap/ptmalloc.py @@ -1,7 +1,13 @@ import copy import importlib from collections import OrderedDict -from enum import Enum + +try: + # Python 3.11, see https://docs.python.org/3/whatsnew/3.11.html#enum + from enum import ReprEnum as Enum +except ImportError: + from enum import Enum + from typing import Any from typing import Callable from typing import Dict