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