equal
deleted
inserted
replaced
91 ret = PyDict_SetItem(dirs, key, val); |
91 ret = PyDict_SetItem(dirs, key, val); |
92 Py_DECREF(val); |
92 Py_DECREF(val); |
93 if (ret == -1) |
93 if (ret == -1) |
94 goto bail; |
94 goto bail; |
95 |
95 |
96 if (pos != 0) |
96 /* Clear the key out since we've already exposed it to Python |
97 PyString_AS_STRING(key)[pos] = '/'; |
97 and can't mutate it further. key's refcount is currently 2 so |
98 else |
98 we can't just use Py_CLEAR. */ |
99 key = NULL; |
99 Py_DECREF(key); |
100 Py_CLEAR(key); |
100 key = NULL; |
101 } |
101 } |
102 ret = 0; |
102 ret = 0; |
103 |
103 |
104 bail: |
104 bail: |
105 Py_XDECREF(key); |
105 Py_XDECREF(key); |