Skip to content

Commit a5ba56a

Browse files
committed
Replace python2-specific function with cython syntax.
1 parent 093a129 commit a5ba56a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

netfilterqueue.pyx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,8 @@ cdef class Packet:
9090

9191
def get_payload(self):
9292
"""Return payload as Python string."""
93-
cdef object py_string = PyString_FromStringAndSize(self.payload,
94-
self.payload_len)
95-
return py_string
96-
93+
return self.payload[:self.payload_len]
94+
9795
cpdef Py_ssize_t get_payload_len(self):
9896
return self.payload_len
9997

0 commit comments

Comments
 (0)