Skip to content

Commit

Permalink
Merge pull request #289 from dpogue/python3.12-fixes
Browse files Browse the repository at this point in the history
Python 3.12 warning fixes
  • Loading branch information
zrax authored Jun 19, 2024
2 parents 1f56a8e + 739fc96 commit 1568702
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions Python/PyPlasma.h
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,12 @@ template <> inline plKeyDef pyPlasma_get(PyObject* value) { return (plKeyDef)PyL
#define _TP_VECTORCALL_PRINT
#endif

#if (PY_MAJOR_VERSION >= 4) || ((PY_MAJOR_VERSION == 3) && (PY_MINOR_VERSION >= 12))
#define _TP_WATCHED_INIT 0,
#else
#define _TP_WATCHED_INIT
#endif

#define PY_PLASMA_TYPE(pyType, classname, doctext) \
PyTypeObject py##pyType##_Type = { \
PyVarObject_HEAD_INIT(nullptr, 0) \
Expand All @@ -596,6 +602,7 @@ template <> inline plKeyDef pyPlasma_get(PyObject* value) { return (plKeyDef)PyL
nullptr, 0, \
_TP_FINALIZE_INIT \
_TP_VECTORCALL_PRINT \
_TP_WATCHED_INIT \
};

#if ((PY_MAJOR_VERSION > 3) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 5))
Expand Down
2 changes: 1 addition & 1 deletion Python/ResManager/pyResManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ PY_PLASMA_DEALLOC(ResManager)

PY_PLASMA_INIT_DECL(ResManager)
{
char* kwdlist[] = { "version", "preserveObjIDs", nullptr };
char* kwdlist[] = { _pycs("version"), _pycs("preserveObjIDs"), nullptr };

int version = PlasmaVer::pvUnknown;
bool preserveObjIDs = false;
Expand Down

0 comments on commit 1568702

Please sign in to comment.