Skip to content

Instantly share code, notes, and snippets.

@dlitz
Created February 22, 2014 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlitz/9163489 to your computer and use it in GitHub Desktop.
Save dlitz/9163489 to your computer and use it in GitHub Desktop.
Fix Python < 2.7 looking for 'plat-linux3' instead of 'plat-linux2'
sys.platform should return "linux2" even if the system was compiled on Linux 3.x or later.
diff -ru Python-2.2.3.orig/configure Python-2.2.3/configure
--- Python-2.2.3.orig/configure 2003-03-29 14:25:14.000000000 -0800
+++ Python-2.2.3/configure 2014-02-22 14:37:36.540457776 -0800
@@ -641,6 +641,8 @@
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux1) MACHDEP="linux1";;
+ linux*) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
'') MACHDEP="unknown";;
diff -ru Python-2.2.3.orig/configure.in Python-2.2.3/configure.in
--- Python-2.2.3.orig/configure.in 2003-03-29 14:25:17.000000000 -0800
+++ Python-2.2.3/configure.in 2014-02-22 14:37:29.668562217 -0800
@@ -68,6 +68,8 @@
MACHDEP="$ac_md_system$ac_md_release"
case $MACHDEP in
+ linux1) MACHDEP="linux1";;
+ linux*) MACHDEP="linux2";;
cygwin*) MACHDEP="cygwin";;
darwin*) MACHDEP="darwin";;
'') MACHDEP="unknown";;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment