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