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