csonpath 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {csonpath-0.6.0/csonpath.egg-info → csonpath-0.7.0}/PKG-INFO +1 -1
- {csonpath-0.6.0 → csonpath-0.7.0/csonpath.egg-info}/PKG-INFO +1 -1
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath.h +6 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath_python.c +6 -1
- {csonpath-0.6.0 → csonpath-0.7.0}/pyproject.toml +2 -2
- {csonpath-0.6.0 → csonpath-0.7.0}/LICENSE +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/MANIFEST.in +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/README.md +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath.egg-info/SOURCES.txt +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath.egg-info/dependency_links.txt +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath.egg-info/requires.txt +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath.egg-info/top_level.txt +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/csonpath_do.h +0 -0
- {csonpath-0.6.0 → csonpath-0.7.0}/setup.cfg +0 -0
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
#define CSONPATH_FIND_ALL_RET_INIT CSONPATH_NEW_ARRAY
|
|
30
30
|
#endif
|
|
31
31
|
|
|
32
|
+
#ifndef CSONPATH_DECREF
|
|
33
|
+
#define CSONPATH_DECREF(obj)
|
|
34
|
+
#endif
|
|
35
|
+
|
|
32
36
|
enum csonpath_instuction_raw {
|
|
33
37
|
CSONPATH_INST_ROOT,
|
|
34
38
|
CSONPATH_INST_GET_OBJ,
|
|
@@ -659,9 +663,11 @@ static _Bool csonpath_do_match(int operand_instruction, CSONPATH_JSON el2, char
|
|
|
659
663
|
if (to_check == CSONPATH_INST_GET_OBJ) { \
|
|
660
664
|
tmp = CSONPATH_NEW_OBJECT(); \
|
|
661
665
|
append_ret = CSONPATH_APPEND_AT(ctx, this_idx, tmp); \
|
|
666
|
+
CSONPATH_DECREF(tmp); \
|
|
662
667
|
} else { \
|
|
663
668
|
tmp = CSONPATH_NEW_ARRAY(); \
|
|
664
669
|
append_ret = CSONPATH_APPEND_AT(ctx, this_idx, tmp); \
|
|
670
|
+
CSONPATH_DECREF(tmp); \
|
|
665
671
|
} \
|
|
666
672
|
walker += cjp->inst_lst[idx].next; \
|
|
667
673
|
if (append_ret < 0) return append_ret; \
|
|
@@ -25,6 +25,10 @@
|
|
|
25
25
|
#define CSONPATH_GET_STR(obj) \
|
|
26
26
|
PyUnicode_AsUTF8(obj)
|
|
27
27
|
|
|
28
|
+
#define CSONPATH_DECREF(obj) \
|
|
29
|
+
Py_DECREF(obj);
|
|
30
|
+
|
|
31
|
+
|
|
28
32
|
#define CSONPATH_GET_NUM(obj) \
|
|
29
33
|
PyLong_AsLong(obj)
|
|
30
34
|
|
|
@@ -203,7 +207,7 @@ static PyObject *find_all(PyCsonPathObject *self, PyObject* args)
|
|
|
203
207
|
|
|
204
208
|
if (!PyArg_ParseTuple(args, "O", &json))
|
|
205
209
|
BAD_ARG();
|
|
206
|
-
PyObject *ret =
|
|
210
|
+
PyObject *ret = csonpath_find_all(self->cp, json);
|
|
207
211
|
return ret;
|
|
208
212
|
}
|
|
209
213
|
|
|
@@ -214,6 +218,7 @@ static PyObject *find_first(PyCsonPathObject *self, PyObject* args)
|
|
|
214
218
|
if (!PyArg_ParseTuple(args, "O", &json))
|
|
215
219
|
BAD_ARG();
|
|
216
220
|
PyObject *ret = csonpath_find_first(self->cp, json);
|
|
221
|
+
Py_INCREF(ret);
|
|
217
222
|
return ret;
|
|
218
223
|
}
|
|
219
224
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "csonpath"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "0.7.0"
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
|
|
10
10
|
[tool.setuptools]
|
|
@@ -22,7 +22,7 @@ dev = [
|
|
|
22
22
|
testpaths = ["tests/python"]
|
|
23
23
|
|
|
24
24
|
[tool.bumpversion]
|
|
25
|
-
current_version = "0.
|
|
25
|
+
current_version = "0.7.0"
|
|
26
26
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
|
27
27
|
serialize = ["{major}.{minor}.{patch}"]
|
|
28
28
|
search = "{current_version}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|