Fix #144758: Python: Inversed unicode comparison in GPUFramebuffer

Regression introduced by d9f38fca5f

Pull Request: https://projects.blender.org/blender/blender/pulls/144908
This commit is contained in:
Jeroen Bakker
2025-08-21 11:52:24 +02:00
parent e196384a68
commit 5767da3b49
2 changed files with 3 additions and 4 deletions

View File

@@ -33,7 +33,6 @@
#if PY_VERSION_HEX < 0x030d0000 /* <3.13 */
# define PyLong_AsInt _PyLong_AsInt
# define PyUnicode_CompareWithASCIIString _PyUnicode_EqualToASCIIString
#endif
/* -------------------------------------------------------------------- */

View File

@@ -295,14 +295,14 @@ static bool pygpu_framebuffer_new_parse_arg(PyObject *o, GPUAttachment *r_attach
return false;
}
if (c_texture && PyUnicode_CompareWithASCIIString(key, c_texture)) {
if (c_texture && PyUnicode_CompareWithASCIIString(key, c_texture) == 0) {
/* Compare only once. */
c_texture = nullptr;
if (!bpygpu_ParseTexture(value, &tmp_attach.tex)) {
return false;
}
}
else if (c_layer && PyUnicode_CompareWithASCIIString(key, c_layer)) {
else if (c_layer && PyUnicode_CompareWithASCIIString(key, c_layer) == 0) {
/* Compare only once. */
c_layer = nullptr;
tmp_attach.layer = PyLong_AsLong(value);
@@ -310,7 +310,7 @@ static bool pygpu_framebuffer_new_parse_arg(PyObject *o, GPUAttachment *r_attach
return false;
}
}
else if (c_mip && PyUnicode_CompareWithASCIIString(key, c_mip)) {
else if (c_mip && PyUnicode_CompareWithASCIIString(key, c_mip) == 0) {
/* Compare only once. */
c_mip = nullptr;
tmp_attach.mip = PyLong_AsLong(value);