diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-11-06 05:39:36 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-11-06 05:39:36 +0400 |
commit | 4c17f8e5de94f3abc65995e7a2964bb9e6ea7642 (patch) | |
tree | 001add4dd98c14818079e5f591d584c5ece7ac6a /source/gameengine/GameLogic/SCA_PythonController.cpp | |
parent | 2a7ade9de24860bbd13e4be8480e9285d1f3fe4c (diff) |
PyUnicode_From_STR_String utility function which passes STR_String to PyUnicode_FromStringAndSize (saves a call to strlen).
Also made CValue::ConvertKeysToPython use faster list creation and improved some of the macro formatting.
Diffstat (limited to 'source/gameengine/GameLogic/SCA_PythonController.cpp')
-rw-r--r-- | source/gameengine/GameLogic/SCA_PythonController.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp index d69358928e6..8a87a734a1c 100644 --- a/source/gameengine/GameLogic/SCA_PythonController.cpp +++ b/source/gameengine/GameLogic/SCA_PythonController.cpp @@ -164,7 +164,7 @@ void SCA_PythonController::SetNamespace(PyObject* pythondictionary) /* Without __file__ set the sys.argv[0] is used for the filename * which ends up with lines from the blender binary being printed in the console */ - PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_FromString(m_scriptName.Ptr())); + PyDict_SetItemString(m_pythondictionary, "__file__", PyUnicode_From_STR_String(m_scriptName)); } #endif @@ -490,7 +490,7 @@ PyObject* SCA_PythonController::pyattr_get_script(void *self_v, const KX_PYATTRI // static_cast<void *>(dynamic_cast<Derived *>(obj)) - static_cast<void *>(obj) SCA_PythonController* self= static_cast<SCA_PythonController*>(self_v); - return PyUnicode_FromString(self->m_scriptText); + return PyUnicode_From_STR_String(self->m_scriptText); } |