Skip to content

Commit

Permalink
Clean up some cruft introduced during the Py_LIMITED_API change
Browse files Browse the repository at this point in the history
  • Loading branch information
jlaine committed Nov 5, 2023
1 parent 7d17de5 commit 3d0d84e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 16 deletions.
6 changes: 1 addition & 5 deletions src/aioquic/_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,7 @@ PyInit__buffer(void)
BufferType = PyType_FromSpec(&BufferType_spec);
if (BufferType == NULL)
return NULL;

PyObject *o = PyType_FromSpec(&BufferType_spec);
if (o == NULL)
return NULL;
PyModule_AddObject(m, "Buffer", o);
PyModule_AddObject(m, "Buffer", BufferType);

return m;
}
13 changes: 2 additions & 11 deletions src/aioquic/_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,6 @@ PyMODINIT_FUNC
PyInit__crypto(void)
{
PyObject* m;
PyObject *o;

m = PyModule_Create(&moduledef);
if (m == NULL)
Expand All @@ -400,20 +399,12 @@ PyInit__crypto(void)
AEADType = PyType_FromSpec(&AEADType_spec);
if (AEADType == NULL)
return NULL;

o = PyType_FromSpec(&AEADType_spec);
if (o == NULL)
return NULL;
PyModule_AddObject(m, "AEAD", o);
PyModule_AddObject(m, "AEAD", AEADType);

HeaderProtectionType = PyType_FromSpec(&HeaderProtectionType_spec);
if (HeaderProtectionType == NULL)
return NULL;

o = PyType_FromSpec(&HeaderProtectionType_spec);
if (o == NULL)
return NULL;
PyModule_AddObject(m, "HeaderProtection", o);
PyModule_AddObject(m, "HeaderProtection", HeaderProtectionType);

// ensure required ciphers are initialised
EVP_add_cipher(EVP_aes_128_ecb());
Expand Down

0 comments on commit 3d0d84e

Please sign in to comment.