--- Include/pyport.h.old	2016-06-25 23:52:29.000000000 +0200
+++ Include/pyport.h	2016-08-01 07:32:02.000000000 +0200
@@ -691,6 +691,12 @@ extern pid_t forkpty(int *, char *, stru
 #endif
 
 #ifdef _PY_PORT_CTYPE_UTF8_ISSUE
+#ifndef __cplusplus
+   /* The workaround below is unsafe in C++ because
+    * the <locale> defines these symbols as real functions,
+    * with a slightly different signature.
+    * See issue #10910
+    */
 #include <ctype.h>
 #include <wctype.h>
 #undef isalnum
@@ -708,6 +714,7 @@ extern pid_t forkpty(int *, char *, stru
 #undef toupper
 #define toupper(c) towupper(btowc(c))
 #endif
+#endif
 
 
 /* Declarations for symbol visibility.