Fix compilation on Python 3.11

Python 3.11 deprecates the supposedly "stable API" PySys_AddXOption().
So switch to using PyConfig.xoptions instead. This means dropping
support for python 3.7 since PyConfig is not available there. So it
rolls.

Fixes #5143
This commit is contained in:
Kovid Goyal
2022-05-29 14:37:14 +05:30
parent 6405849a1b
commit 0df9a5d5c5
2 changed files with 81 additions and 56 deletions

View File

@@ -26,8 +26,8 @@ from typing import (
from glfw import glfw
from glfw.glfw import Command, CompileKey
if sys.version_info[:2] < (3, 7):
raise SystemExit('kitty requires python >= 3.7')
if sys.version_info[:2] < (3, 8):
raise SystemExit('kitty requires python >= 3.8')
base = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, base)
del sys.path[0]