76b6d9
commit b571f3adffdcbed23f35ea39b0ca43809dbb4f5b
76b6d9
Author: Florian Weimer <fweimer@redhat.com>
76b6d9
Date:   Fri Apr 22 19:34:52 2022 +0200
76b6d9
76b6d9
    scripts/glibcelf.py: Mark as UNSUPPORTED on Python 3.5 and earlier
76b6d9
    
76b6d9
    enum.IntFlag and enum.EnumMeta._missing_ support are not part of
76b6d9
    earlier Python versions.
76b6d9
76b6d9
diff --git a/scripts/glibcelf.py b/scripts/glibcelf.py
76b6d9
index 8f7d0ca184845714..da0d5380f33a195e 100644
76b6d9
--- a/scripts/glibcelf.py
76b6d9
+++ b/scripts/glibcelf.py
76b6d9
@@ -28,6 +28,12 @@ import collections
76b6d9
 import enum
76b6d9
 import struct
76b6d9
 
76b6d9
+if not hasattr(enum, 'IntFlag'):
76b6d9
+    import sys
76b6d9
+    sys.stdout.write(
76b6d9
+        'warning: glibcelf.py needs Python 3.6 for enum support\n')
76b6d9
+    sys.exit(77)
76b6d9
+
76b6d9
 class _OpenIntEnum(enum.IntEnum):
76b6d9
     """Integer enumeration that supports arbitrary int values."""
76b6d9
     @classmethod