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