summarylogtreecommitdiffstats
path: root/0001_python3_fix.patch
blob: e1c24c6bb244e3ad660ff0c27d4d54a9b2395a0d (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
diff -ruN a/config/__init__.py b/config/__init__.py
--- a/config/__init__.py	2019-02-08 04:16:27.000000000 -0500
+++ b/config/__init__.py	2019-08-18 16:08:36.326638519 -0400
@@ -277,7 +277,7 @@
 updated_csig = set()
 
 
-def decider_hack(dep, target, prev_ni):
+def decider_hack(dep, target, prev_ni, *args, **kwargs):
     from SCons.Util import MD5signature
 
     #print('%s ?= %s %s' % (dep, target, prev_ni.csig))
diff -ruN a/config/resources/__init__.py b/config/resources/__init__.py
--- a/config/resources/__init__.py	2019-02-08 04:16:27.000000000 -0500
+++ b/config/resources/__init__.py	2019-08-18 16:13:53.866632487 -0400
@@ -18,7 +18,7 @@
 
 
 def start_file(ctx, path):
-    f = open(path, 'wb')
+    f = open(path, 'w')
 
     note = ('WARNING: This file was auto generated.  Please do NOT '
             'edit directly or check in to source control.')
@@ -108,7 +108,8 @@
         while True:
             count = 0
             for c in f.read(102400):
-                write_string(ctx, out, '%d,' % ord(c))
+                if not isinstance(c, int): c = ord(c)
+                write_string(ctx, out, '%d,' % c)
                 count += 1
 
             if count == 0: break
@@ -219,7 +220,7 @@
     name = str(target[0])
     data_dir = os.path.splitext(name)[0] + ".data"
     target += get_targets(exclude, str(source[0]), data_dir, [0])
-    print(map(str, target))
+    print(tuple(map(str, target)))
     Depends(target, FindFile('cbang/util/Resource.h', env['CPPPATH']))
     return target, source
 
diff -ruN a/SConstruct b/SConstruct
--- a/SConstruct	2019-02-08 04:16:27.000000000 -0500
+++ b/SConstruct	2019-08-18 16:08:36.326638519 -0400
@@ -35,7 +35,7 @@
     lines = os.popen('svn status -v').readlines()
     lines = filter(lambda l: len(l) and l[0] in 'MA ', lines)
     files = map(lambda l: l.split()[-1], lines)
-    files = filter(lambda f: not os.path.isdir(f), files)
+    files = list(filter(lambda f: not os.path.isdir(f), files))
 
     tar = env.TarBZ2Dist('libcbang' + libversion, files)
     Alias('dist', tar)
@@ -89,7 +89,7 @@
 # Build in 'build'
 import re
 VariantDir('build', 'src', duplicate = False)
-src = map(lambda path: re.sub(r'^src/', 'build/', str(path)), src)
+src = list(map(lambda path: re.sub(r'^src/', 'build/', str(path)), src))
 
 
 # Resources
diff -ruN a/src/libevent/SConscript b/src/libevent/SConscript
--- a/src/libevent/SConscript	2019-02-08 04:16:27.000000000 -0500
+++ b/src/libevent/SConscript	2019-08-18 16:22:45.103289070 -0400
@@ -190,7 +190,11 @@
     # TODO Define EVENT__HAVE_WORKING_KQUEUE if kqueue works correctly w/ pipes
 
     # to_def
-    from string import maketrans
+    try:
+        from string import maketrans
+    except ImportError:
+        def maketrans(_from, _to): return ''.maketrans(_from, _to)
+
     trans = maketrans('/. *', '___P')
 
     def to_def(name):
@@ -330,7 +334,7 @@
 
 # OpenSSL
 if not env.CBConfigEnabled('openssl'):
-    src = filter(lambda f: not 'openssl' in f.path, src)
+    src = list(filter(lambda f: not 'openssl' in f.path, src))
 
 # libkern
 conf.CBCheckLib('kern')