After discussion on Bug #695958 here is an updated patch.  This exposes the
triplet on sys.implementation._multiarch
=== modified file 'debian/changelog'
--- debian/changelog	2012-12-04 04:36:42 +0000
+++ debian/changelog	2012-12-20 15:04:24 +0000
@@ -1,3 +1,10 @@
+python3.3 (3.3.0-7) experimental; urgency=low
+
+  * debian/patches/sys-implementation.diff: Expose multiarch triplet value
+    as sys.implementation._multiarch.  Closes: #695959
+
+ -- Barry Warsaw <ba...@python.org>  Fri, 14 Dec 2012 15:50:45 -0500
+
 python3.3 (3.3.0-6) experimental; urgency=low
 
   * Don't use xattrs on kfreebsd and the Hurd.

=== modified file 'debian/patches/series.in'
--- debian/patches/series.in	2012-12-04 04:36:42 +0000
+++ debian/patches/series.in	2012-12-14 20:52:45 +0000
@@ -54,3 +54,4 @@
 ext-no-libpython-link.diff
 add-python-config-sh.diff
 kfreebsd-xattrs.diff
+sys-implementation.diff

=== added file 'debian/patches/sys-implementation.diff'
--- debian/patches/sys-implementation.diff	1970-01-01 00:00:00 +0000
+++ debian/patches/sys-implementation.diff	2012-12-20 13:00:31 +0000
@@ -0,0 +1,28 @@
+--- a/Makefile.pre.in
++++ b/Makefile.pre.in
+@@ -647,6 +647,7 @@
+ Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile
+ 	$(CC) -c $(PY_CORE_CFLAGS) \
+ 		-DABIFLAGS='"$(ABIFLAGS)"' \
++		-DMULTIARCH='"$(MULTIARCH)"' \
+ 		-o $@ $(srcdir)/Python/sysmodule.c
+ 
+ $(IO_OBJS): $(IO_H)
+--- a/Python/sysmodule.c
++++ b/Python/sysmodule.c
+@@ -1534,6 +1534,15 @@
+     if (res < 0)
+         goto error;
+ 
++    /* For Debian multiarch support. */
++    value = PyUnicode_FromString(MULTIARCH);
++    if (value == NULL)
++        goto error;
++    res = PyDict_SetItemString(impl_info, "_multiarch", value);
++    Py_DECREF(value);
++    if (res < 0)
++        goto error;
++
+     /* dict ready */
+ 
+     ns = _PyNamespace_New(impl_info);

Reply via email to