summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-07-24 19:33:07 +0200
committerMichał Górny <mgorny@gentoo.org>2021-07-24 19:33:42 +0200
commiteaf5eeeb1a75fb4d3b51e17edc9d039310da82e6 (patch)
tree4e984a5ecf35503cacaf7e00d6b19b7be3f9e725 /dev-python/pysimdjson/files
parentdev-python/pyproject2setuppy: Remove old (diff)
downloadgentoo-eaf5eeeb1a75fb4d3b51e17edc9d039310da82e6.tar.gz
gentoo-eaf5eeeb1a75fb4d3b51e17edc9d039310da82e6.tar.bz2
gentoo-eaf5eeeb1a75fb4d3b51e17edc9d039310da82e6.zip
dev-python/pysimdjson: Remove old
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pysimdjson/files')
-rw-r--r--dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch53
1 files changed, 0 insertions, 53 deletions
diff --git a/dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch b/dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch
deleted file mode 100644
index 34b8f4aa9e29..000000000000
--- a/dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-commit 1145be6cac70ed065f2053977d470f3f771ac6a0
-Author: Tyler Kennedy <tk@tkte.ch>
-Date: Sun May 23 15:55:28 2021 -0400
-
- Empty buffers now raise identical error to empty bytes. Closes #81.
-
-diff --git a/simdjson/csimdjson.pyx b/simdjson/csimdjson.pyx
-index 095a183..c278e08 100644
---- a/simdjson/csimdjson.pyx
-+++ b/simdjson/csimdjson.pyx
-@@ -478,6 +478,13 @@ cdef class Parser:
- # type-specific APIs, but gives much greater compatibility.
- data = src
-
-+ if data.size == 0:
-+ # If we were given a completely empty buffer, trying to access
-+ # a stride in the next step will cause a (potentially
-+ # confusing) IndexError. This isn't a very good error message,
-+ # but it's identical to the one simdjson would have raised.
-+ raise ValueError('Empty: no JSON found')
-+
- return element_to_primitive(
- self,
- dereference(self.c_parser).parse(
-diff --git a/tests/test_parser.py b/tests/test_parser.py
-index 88e7207..d3a28c7 100644
---- a/tests/test_parser.py
-+++ b/tests/test_parser.py
-@@ -1,3 +1,4 @@
-+import io
- import pathlib
-
- import pytest
-@@ -32,6 +33,19 @@ def test_parse_str(parser):
- assert doc.as_dict() == {'hello': 'world'}
-
-
-+def test_parse_empty_buffer(parser):
-+ """Ensure trying to parse an empty buffer returns an error consistent
-+ with attempting to parse an empty bytestring."""
-+ # Issue #81
-+ with pytest.raises(ValueError) as bytes_exc:
-+ parser.parse(b'')
-+
-+ with pytest.raises(ValueError) as buffer_exc:
-+ parser.parse(io.BytesIO(b'').getbuffer())
-+
-+ assert str(bytes_exc.value) == str(buffer_exc.value)
-+
-+
- def test_unicode_decode_error(parser):
- """Ensure the parser raises encoding issues."""
- with pytest.raises(UnicodeDecodeError):