Merge pull request #18 from WGH-/master
use self.payload[:self.payload_len] for getting python string
This commit is contained in:
commit
adb254540b
804
netfilterqueue.c
804
netfilterqueue.c
File diff suppressed because it is too large
Load Diff
|
@ -100,12 +100,7 @@ cdef class Packet:
|
|||
def get_payload(self):
|
||||
"""Return payload as Python string."""
|
||||
cdef object py_string
|
||||
if cpython.version.PY_MAJOR_VERSION >= 3:
|
||||
py_string = PyBytes_FromStringAndSize(
|
||||
self.payload, self.payload_len)
|
||||
else:
|
||||
py_string = PyString_FromStringAndSize(
|
||||
self.payload, self.payload_len)
|
||||
py_string = self.payload[:self.payload_len]
|
||||
return py_string
|
||||
|
||||
cpdef Py_ssize_t get_payload_len(self):
|
||||
|
|
Loading…
Reference in New Issue