Skip to content

Commit 62fec63

Browse files
committed
Merge pull request #1 from trothamel/master
Replace python2-specific function with cython syntax.
2 parents 53a55fd + a5ba56a commit 62fec63

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
@@ -93,10 +93,8 @@ cdef class Packet:
9393

9494
def get_payload(self):
9595
"""Return payload as Python string."""
96-
cdef object py_string = PyString_FromStringAndSize(self.payload,
97-
self.payload_len)
98-
return py_string
99-
96+
return self.payload[:self.payload_len]
97+
10098
cpdef Py_ssize_t get_payload_len(self):
10199
return self.payload_len
102100

0 commit comments

Comments
 (0)