# HG changeset patch # User Alain Mazy # Date 1765908862 -3600 # Node ID e6818f1ef1f3fb04cba841f9f2de86df1bdccc68 # Parent f96ce88ff7641c04c8a774e6c2e1789192ad3281 fix compat with old python lib diff -r f96ce88ff764 -r e6818f1ef1f3 Sources/StorageArea3.cpp --- a/Sources/StorageArea3.cpp Tue Dec 16 15:00:35 2025 +0100 +++ b/Sources/StorageArea3.cpp Tue Dec 16 19:14:22 2025 +0100 @@ -123,7 +123,7 @@ ORTHANC_PLUGINS_LOG_ERROR("The Python StorageCreate2 callback has not returned an int as the first element of the return tuple"); return OrthancPluginErrorCode_Plugin; } - else if (!PyBytes_Check(pyTargetBuffer) && !Py_IsNone(pyTargetBuffer)) + else if (!PyBytes_Check(pyTargetBuffer) && pyTargetBuffer != Py_None) { ORTHANC_PLUGINS_LOG_ERROR("The Python StorageCreate2 callback has not returned a byte array as the second element of the return tuple"); return OrthancPluginErrorCode_Plugin; @@ -133,7 +133,7 @@ if (returnCode == OrthancPluginErrorCode_Success) { - if (Py_IsNone(pyTargetBuffer)) // no custom-data, return directly + if (pyTargetBuffer == Py_None) // no custom-data, return directly { customData = NULL; return returnCode;