Improved version of patch for HPUX from David Arnold.
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 0d59ced..8758430 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -69,10 +69,7 @@
 #elif defined(__DGUX)
 #  define PY_PTHREAD_D6
 
-#elif defined(__hpux)
-/* From what I can see, HP-UX 10.20 pthreads looks
- * like D4 flavour.
- */
+#elif defined(__hpux) && defined(_DECTHREADS_)
 #  define PY_PTHREAD_D4
 
 #else /* Default case */