summarylogtreecommitdiffstats
path: root/commit_f7956b4_partial.patch
blob: 5aa01ebe40a466abf6bbec8f69e42a77c16c9100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
commit f7956b47ac1ffd209bafd8b20ff19bedaa6d0cad
Author: Gabriele Fariello <gabriele.fariello@gmail.com>
Date:   Fri Mar 1 18:51:23 2019 +0000

    Updated to make python3 compatible

diff --git a/ebtables.py b/ebtables.py
index e5903d8..eb562e3 100644
--- a/ebtables.py
+++ b/ebtables.py
@@ -85,7 +85,8 @@ _verify = """
     void ebt_early_init_once(void);
     """
 
-_hash = hashlib.sha1('\0'.join([_cdef, _verify])).hexdigest()
+# Changed this to be python3 compatible which requires string encoding
+_hash = hashlib.sha1(_cdef.encode('utf-8') + _verify.encode('utf-8')).hexdigest()
 
 ffi.cdef(_cdef)
 
@@ -99,7 +100,8 @@ _ebtc = ffi.verify(_verify,
 _ebtc.ebt_early_init_once()
 
 _ebtc.ebt_silent = 1
-_ebtc.ebt_errormsg[0] = '\0'
+# Changed this to be python3 compatible which requires string encoding
+_ebtc.ebt_errormsg[0] = '\0'.encode("ascii")
 
 
 def _get_errormsg():