Skip to content

Commit 51a277a

Browse files
committed
c-ext: correctly define fully qualified type names to zstandard.*
These have been wrong for years. I'm honestly a bit surprised that nothing complains about the mismatch: this thing is easy enough to validate at module import time by the interpreter or via analysis of all types post import via some linter. I guess strong typing has never been Python's strength. Closes #248.
1 parent 9ccbc39 commit 51a277a

17 files changed

+27
-20
lines changed

c-ext/bufferutil.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ PyType_Slot ZstdBufferWithSegmentsSlots[] = {
259259
};
260260

261261
PyType_Spec ZstdBufferWithSegmentsSpec = {
262-
"zstd.BufferWithSegments",
262+
"zstandard.backend_c.BufferWithSegments",
263263
sizeof(ZstdBufferWithSegments),
264264
0,
265265
Py_TPFLAGS_DEFAULT,
@@ -290,7 +290,7 @@ PyType_Slot ZstdBufferSegmentsSlots[] = {
290290
};
291291

292292
PyType_Spec ZstdBufferSegmentsSpec = {
293-
"zstd.BufferSegments",
293+
"zstandard.backend_c.BufferSegments",
294294
sizeof(ZstdBufferSegments),
295295
0,
296296
Py_TPFLAGS_DEFAULT,
@@ -350,7 +350,7 @@ PyType_Slot ZstdBufferSegmentSlots[] = {
350350
};
351351

352352
PyType_Spec ZstdBufferSegmentSpec = {
353-
"zstd.BufferSegment",
353+
"zstandard.backend_c.BufferSegment",
354354
sizeof(ZstdBufferSegment),
355355
0,
356356
Py_TPFLAGS_DEFAULT,
@@ -518,7 +518,7 @@ PyType_Slot ZstdBufferWithSegmentsCollectionSlots[] = {
518518
};
519519

520520
PyType_Spec ZstdBufferWithSegmentsCollectionSpec = {
521-
"zstd.BufferWithSegmentsCollection",
521+
"zstandard.backend_c.BufferWithSegmentsCollection",
522522
sizeof(ZstdBufferWithSegmentsCollection),
523523
0,
524524
Py_TPFLAGS_DEFAULT,

c-ext/compressionchunker.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ PyType_Slot ZstdCompressionChunkerIteratorSlots[] = {
144144
};
145145

146146
PyType_Spec ZstdCompressionChunkerIteratorSpec = {
147-
"zstd.ZstdCompressionChunkerIterator",
147+
"zstandard.backend_c.ZstdCompressionChunkerIterator",
148148
sizeof(ZstdCompressionChunkerIterator),
149149
0,
150150
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
@@ -286,7 +286,7 @@ PyType_Slot ZstdCompressionChunkerSlots[] = {
286286
};
287287

288288
PyType_Spec ZstdCompressionChunkerSpec = {
289-
"zstd.ZstdCompressionChunkerType",
289+
"zstandard.backend_c.ZstdCompressionChunkerType",
290290
sizeof(ZstdCompressionChunker),
291291
0,
292292
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/compressiondict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ PyType_Slot ZstdCompressionDictSlots[] = {
326326
};
327327

328328
PyType_Spec ZstdCompressionDictSpec = {
329-
"zstd.ZstdCompressionDict",
329+
"zstandard.backend_c.ZstdCompressionDict",
330330
sizeof(ZstdCompressionDict),
331331
0,
332332
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/compressionparams.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ PyType_Slot ZstdCompressionParametersSlots[] = {
479479
};
480480

481481
PyType_Spec ZstdCompressionParametersSpec = {
482-
"zstd.ZstdCompressionParameters",
482+
"zstandard.backend_c.ZstdCompressionParameters",
483483
sizeof(ZstdCompressionParametersObject),
484484
0,
485485
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/compressionreader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ PyType_Slot ZstdCompressionReaderSlots[] = {
788788
};
789789

790790
PyType_Spec ZstdCompressionReaderSpec = {
791-
"zstd.ZstdCompressionReader",
791+
"zstandard.backend_c.ZstdCompressionReader",
792792
sizeof(ZstdCompressionReader),
793793
0,
794794
Py_TPFLAGS_DEFAULT,

c-ext/compressionwriter.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ PyType_Slot ZstdCompressionWriterSlots[] = {
330330
};
331331

332332
PyType_Spec ZstdCompressionWriterSpec = {
333-
"zstd.ZstdCompressionWriter",
333+
"zstandard.backend_c.ZstdCompressionWriter",
334334
sizeof(ZstdCompressionWriter),
335335
0,
336336
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/compressobj.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ PyType_Slot ZstdCompressionObjSlots[] = {
202202
};
203203

204204
PyType_Spec ZstdCompressionObjSpec = {
205-
"zstd.ZstdCompressionObj",
205+
"zstandard.backend_c.ZstdCompressionObj",
206206
sizeof(ZstdCompressionObj),
207207
0,
208208
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/compressor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ PyType_Slot ZstdCompressorSlots[] = {
15371537
};
15381538

15391539
PyType_Spec ZstdCompressorSpec = {
1540-
"zstd.ZstdCompressor",
1540+
"zstandard.backend_c.ZstdCompressor",
15411541
sizeof(ZstdCompressor),
15421542
0,
15431543
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/compressoriterator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ PyType_Slot ZstdCompressorIteratorSlots[] = {
194194
};
195195

196196
PyType_Spec ZstdCompressorIteratorSpec = {
197-
"zstd.ZstdCompressorIterator",
197+
"zstandard.backend_c.ZstdCompressorIterator",
198198
sizeof(ZstdCompressorIterator),
199199
0,
200200
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,

c-ext/constants.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ void constants_module_init(PyObject *mod) {
2525
version = PyUnicode_FromString(PYTHON_ZSTANDARD_VERSION);
2626
PyModule_AddObject(mod, "__version__", version);
2727

28-
ZstdError = PyErr_NewException("zstd.ZstdError", NULL, NULL);
28+
ZstdError = PyErr_NewException("zstandard.backend_c.ZstdError", NULL, NULL);
2929
PyModule_AddObject(mod, "ZstdError", ZstdError);
3030

3131
PyModule_AddIntConstant(mod, "FLUSH_BLOCK", 0);

0 commit comments

Comments
 (0)