brltty/brltty-6.6-cython3.patch
Adam Williamson ee571d6d47 Fix the Cython 3 crash and build with Cython 3 again
Thanks to Lukáš Tyrychtr and Samuel Thibault for the diagnosis
and fix.
2023-08-15 09:35:12 -07:00

21 lines
827 B
Diff

--- python2/Bindings/Python/brlapi.pyx 2023-07-17 07:55:47.000000000 -0700
+++ python2/Bindings/Python/brlapi.pyx.new 2023-08-15 09:06:23.675136077 -0700
@@ -453,6 +453,7 @@
c_brlapi.brlapi_protocolExceptionInit(self.h)
if self.fd == -1:
c_brlapi.free(self.h)
+ self.h = NULL
raise ConnectionError(self.settings.host, self.settings.auth)
def closeConnection(self):
@@ -465,7 +466,8 @@
"""Release resources used by the connection"""
if self.fd != -1:
c_brlapi.brlapi__closeConnection(self.h)
- c_brlapi.free(self.h)
+ if self.h != NULL:
+ c_brlapi.free(self.h)
property host:
"""To get authorized to connect, libbrlapi has to tell the BrlAPI server a secret key, for security reasons. This is the path to the file which holds it; it will hence have to be readable by the application."""