--- a/boost/parameter/python.hpp
+++ b/boost/parameter/python.hpp
@@ -66,7 +66,11 @@ namespace boost { namespace parameter {
       
       if (Py_TYPE(&unspecified) == 0)
       {
+#if PY_VERSION_HEX >= 0x03090000
+          Py_SET_TYPE(&unspecified, &PyType_Type);
+#else
           Py_TYPE(&unspecified) = &PyType_Type;
+#endif
           PyType_Ready(&unspecified);
       }
       
