aboutsummaryrefslogtreecommitdiff
path: root/Lib/python
diff options
context:
space:
mode:
authorAndrew Rogers <andrew.rogers@wdc.com>2018-11-27 23:30:51 +0000
committerAndrew Rogers <andrew.rogers@wdc.com>2018-11-27 23:30:51 +0000
commit0fecd1538faa45b5818776b676be41aca7780c25 (patch)
treee8d7ff910b3e4ad5ec9386b4eb8c9f97762c7c38 /Lib/python
parent3c090307a48b0c6a1f034357b751bc9469cc111f (diff)
downloadswig-0fecd1538faa45b5818776b676be41aca7780c25.tar.gz
Cleanup accessing/decref of globals, to avoid code bloat in init function.
Diffstat (limited to 'Lib/python')
-rw-r--r--Lib/python/pyinit.swg6
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg
index c155185cd..d8f3bf444 100644
--- a/Lib/python/pyinit.swg
+++ b/Lib/python/pyinit.swg
@@ -227,11 +227,7 @@ SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void
SWIGINTERN PyObject *
SWIG_globals(void) {
static PyObject *_SWIG_globals = 0;
- if (!_SWIG_globals) {
- _SWIG_globals = SWIG_newvarlink();
- } else {
- Py_INCREF(_SWIG_globals);
- }
+ if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
return _SWIG_globals;
}