Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-07-22 15:21:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-07-22 15:21:01 +0400
commit382050501dc0036dc28434b205215ebc21a0cf1b (patch)
tree4303afd605a8aaddf8145f161c52e606ee647113 /source/gameengine/Expressions/PyObjectPlus.cpp
parent0e933d089df3a17327caf8700c19df9f419a2973 (diff)
remove duplicate function for printing the current file:line of a python script in the BGE.
Diffstat (limited to 'source/gameengine/Expressions/PyObjectPlus.cpp')
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp38
1 files changed, 1 insertions, 37 deletions
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 3a25df73f9b..92be769ed71 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -1184,46 +1184,10 @@ void PyObjectPlus::SetDeprecationWarnings(bool ignoreDeprecationWarnings)
m_ignore_deprecation_warnings = ignoreDeprecationWarnings;
}
-void PyDebugLine()
-{
- // import sys; print '\t%s:%d' % (sys._getframe(0).f_code.co_filename, sys._getframe(0).f_lineno)
-
- PyObject *getframe, *frame;
- PyObject *f_lineno, *f_code, *co_filename;
-
- getframe = PySys_GetObject((char *)"_getframe"); // borrowed
- if (getframe) {
- frame = PyObject_CallObject(getframe, NULL);
- if (frame) {
- f_lineno= PyObject_GetAttrString(frame, "f_lineno");
- f_code= PyObject_GetAttrString(frame, "f_code");
- if (f_lineno && f_code) {
- co_filename= ((PyCodeObject *)f_code)->co_filename; /* borrow */
- if (co_filename) {
-
- printf("\t%s:%d\n", _PyUnicode_AsString(co_filename), (int)PyLong_AsSsize_t(f_lineno));
-
- Py_DECREF(f_lineno);
- Py_DECREF(f_code);
- Py_DECREF(frame);
- return;
- }
- }
-
- Py_XDECREF(f_lineno);
- Py_XDECREF(f_code);
- Py_DECREF(frame);
- }
-
- }
- PyErr_Clear();
- printf("\tERROR - Could not access sys._getframe(0).f_lineno or sys._getframe().f_code.co_filename\n");
-}
-
void PyObjectPlus::ShowDeprecationWarning_func(const char* old_way,const char* new_way)
{
printf("Method %s is deprecated, please use %s instead.\n", old_way, new_way);
- PyDebugLine();
+ PyC_LineSpit();
}
void PyObjectPlus::ClearDeprecationWarning()