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>2019-03-29 22:12:48 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-03-29 23:14:28 +0300
commit25ec4b437fe927205a810470cdc23efd7282c85b (patch)
tree6d7ba2fe73703915b4b94d3f2dab03fb731e9544 /source/blender/python/generic/py_capi_utils.c
parent18d06e8d21ed8c9a19df4205abcd7ed17eb9af00 (diff)
Cleanup: style, use braces for the Python API
Diffstat (limited to 'source/blender/python/generic/py_capi_utils.c')
-rw-r--r--source/blender/python/generic/py_capi_utils.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c
index f18e794ead3..0c10737609c 100644
--- a/source/blender/python/generic/py_capi_utils.c
+++ b/source/blender/python/generic/py_capi_utils.c
@@ -319,8 +319,12 @@ void PyC_FileAndNum(const char **filename, int *lineno)
{
PyFrameObject *frame;
- if (filename) *filename = NULL;
- if (lineno) *lineno = -1;
+ if (filename) {
+ *filename = NULL;
+ }
+ if (lineno) {
+ *lineno = -1;
+ }
if (!(frame = PyThreadState_GET()->frame)) {
return;
@@ -384,10 +388,13 @@ PyObject *PyC_Object_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...)
attr = va_arg(vargs, char *);
item = PyObject_GetAttrString(item, attr);
- if (item)
+ if (item) {
Py_DECREF(item);
- else /* python will set the error value here */
+ }
+ else {
+ /* python will set the error value here */
break;
+ }
}
va_end(vargs);
@@ -527,8 +534,9 @@ PyObject *PyC_ExceptionBuffer(void)
PyObject *error_type, *error_value, *error_traceback;
- if (!PyErr_Occurred())
+ if (!PyErr_Occurred()) {
return NULL;
+ }
PyErr_Fetch(&error_type, &error_value, &error_traceback);
@@ -593,8 +601,9 @@ PyObject *PyC_ExceptionBuffer_Simple(void)
PyObject *error_type, *error_value, *error_traceback;
- if (!PyErr_Occurred())
+ if (!PyErr_Occurred()) {
return NULL;
+ }
PyErr_Fetch(&error_type, &error_value, &error_traceback);
@@ -775,9 +784,10 @@ void PyC_SetHomePath(const char *py_path_bundle)
#ifdef __APPLE__
/* OSX allow file/directory names to contain : character (represented as / in the Finder)
* but current Python lib (release 3.1.1) doesn't handle these correctly */
- if (strchr(py_path_bundle, ':'))
+ if (strchr(py_path_bundle, ':')) {
printf("Warning : Blender application is located in a path containing : or / chars\
\nThis may make python import function fail\n");
+ }
#endif