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:
@@ -33,7 +33,6 @@
|
||||
|
||||
#if PY_VERSION_HEX < 0x030d0000 /* <3.13 */
|
||||
# define PyLong_AsInt _PyLong_AsInt
|
||||
# define PyUnicode_CompareWithASCIIString _PyUnicode_EqualToASCIIString
|
||||
#endif
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user