From 7ed0c40f68b24ba829d760aa03325fd190f3059f Mon Sep 17 00:00:00 2001 From: Luke Na Date: Wed, 25 Mar 2026 16:19:34 +0800 Subject: [PATCH 1/2] Add patch about replace shlex from pipes on Python 3.13+ --- .../ninja-1.10.0-fix-python3.13-pipes-module.patch | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch diff --git a/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch b/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch new file mode 100644 index 0000000..b76d75d --- /dev/null +++ b/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch @@ -0,0 +1,11 @@ +--- configure.py.orig 2026-03-25 16:12:10.647584559 +0800 ++++ configure.py 2026-03-25 16:12:10.651584755 +0800 +@@ -23,7 +23,7 @@ + + from optparse import OptionParser + import os +-import pipes ++import shlex as pipes + import string + import subprocess + import sys From f1714e94183aa9f9c75d0bcba392c1e873b5204f Mon Sep 17 00:00:00 2001 From: Luke Na Date: Wed, 25 Mar 2026 16:45:22 +0800 Subject: [PATCH 2/2] Use new library only if the import fails. --- Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch b/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch index b76d75d..9aa853e 100644 --- a/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch +++ b/Patches/ninja-1.10.0-fix-python3.13-pipes-module.patch @@ -1,11 +1,14 @@ --- configure.py.orig 2026-03-25 16:12:10.647584559 +0800 -+++ configure.py 2026-03-25 16:12:10.651584755 +0800 -@@ -23,7 +23,7 @@ ++++ configure.py 2026-03-25 16:39:00.122488627 +0800 +@@ -23,7 +23,10 @@ from optparse import OptionParser import os -import pipes -+import shlex as pipes ++try: ++ import pipes ++except ImportError: ++ import shlex as pipes import string import subprocess import sys