~bennabiy/+junk/python-xlib

« back to all changes in this revision

Viewing changes to debian/patches/python3

  • Committer: Package Import Robot
  • Author(s): Andrew Shadura, Ramkumar Ramachandra, Andrew Shadura
  • Date: 2015-08-13 08:14:19 UTC
  • mfrom: (6.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20150813081419-hdefinnghp2iydkx
Tags: 0.14+20091101-3
[ Ramkumar Ramachandra ]
* Remove useless debugging output (Closes: #565996)

[ Andrew Shadura ]
* Switch to 3.0 (quilt) format.
* Rename patches.
* Use debhelper 9 in its short form.
* Use pybuild.
* Bump Standards-Version.
* Don't build or install PostScript documentation and info files.
* Use system-provided texi2html instead of a shipped version
  (Closes: #795057).
* Update debian/copyright (Closes: #795057).
* Don't install Makefile or texi2html with the documentation.
* Set executable bit for examples.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Port code to work with Python 3
2
 
Author: Martin Pitt <martin.pitt@ubuntu.com>
3
 
Forwarded: http://sourceforge.net/p/python-xlib/patches/5/
4
 
Updated: 2013-10-11
5
 
 
6
 
Index: python-xlib-0.14+20091101/Xlib/protocol/display.py
7
 
===================================================================
8
 
--- python-xlib-0.14+20091101.orig/Xlib/protocol/display.py     2013-10-11 14:19:21.117971349 -0400
9
 
+++ python-xlib-0.14+20091101/Xlib/protocol/display.py  2013-10-11 14:19:21.085971348 -0400
10
 
@@ -31,8 +31,17 @@
11
 
 from Xlib.support import lock, connect
12
 
 
13
 
 # Xlib.protocol modules
14
 
-import rq
15
 
-import event
16
 
+from Xlib.protocol import rq, event
17
 
+
18
 
+# in Python 3, bytes are an actual array; in python 2, bytes are still
19
 
+# string-like, so in order to get an array element we need to call ord()
20
 
+if sys.version[0] >= '3':
21
 
+    def _bytes_item(x):
22
 
+        return x
23
 
+else:
24
 
+    def _bytes_item(x):
25
 
+        return ord(x)
26
 
+
27
 
 
28
 
 class Display:
29
 
     resource_classes = {}
30
 
@@ -83,8 +92,8 @@
31
 
         # Data used by the send-and-recieve loop
32
 
         self.sent_requests = []
33
 
         self.request_length = 0
34
 
-        self.data_send = ''
35
 
-        self.data_recv = ''
36
 
+        self.data_send = b''
37
 
+        self.data_recv = b''
38
 
         self.data_sent_bytes = 0
39
 
 
40
 
         # Resource ID structures
41
 
@@ -227,7 +236,7 @@
42
 
         self.resource_id_lock.acquire()
43
 
         try:
44
 
             i = self.last_resource_id
45
 
-            while self.resource_ids.has_key(i):
46
 
+            while i in self.resource_ids:
47
 
                 i = i + 1
48
 
                 if i > self.info.resource_id_mask:
49
 
                     i = 0
50
 
@@ -503,7 +512,7 @@
51
 
 
52
 
             # Ignore errors caused by a signal recieved while blocking.
53
 
             # All other errors are re-raised.
54
 
-            except select.error, err:
55
 
+            except select.error as err:
56
 
                 if err[0] != errno.EINTR:
57
 
                     raise err
58
 
 
59
 
@@ -518,7 +527,7 @@
60
 
             if ws:
61
 
                 try:
62
 
                     i = self.socket.send(self.data_send)
63
 
-                except socket.error, err:
64
 
+                except socket.error as err:
65
 
                     self.close_internal('server: %s' % err[1])
66
 
                     raise self.socket_error
67
 
 
68
 
@@ -534,7 +543,7 @@
69
 
                 if recieving:
70
 
                     try:
71
 
                         bytes_recv = self.socket.recv(4096)
72
 
-                    except socket.error, err:
73
 
+                    except socket.error as err:
74
 
                         self.close_internal('server: %s' % err[1])
75
 
                         raise self.socket_error
76
 
 
77
 
@@ -640,7 +649,7 @@
78
 
                 return gotreq
79
 
 
80
 
             # Check the first byte to find out what kind of response it is
81
 
-            rtype = ord(self.data_recv[0])
82
 
+            rtype = _bytes_item(self.data_recv[0])
83
 
 
84
 
             # Error resposne
85
 
             if rtype == 0:
86
 
@@ -660,13 +669,13 @@
87
 
 
88
 
     def parse_error_response(self, request):
89
 
         # Code is second byte
90
 
-        code = ord(self.data_recv[1])
91
 
+        code = _bytes_item(self.data_recv[1])
92
 
 
93
 
         # Fetch error class
94
 
         estruct = self.error_classes.get(code, error.XError)
95
 
 
96
 
         e = estruct(self, self.data_recv[:32])
97
 
-        self.data_recv = buffer(self.data_recv, 32)
98
 
+        self.data_recv = self.data_recv[32:]
99
 
 
100
 
         # print 'recv Error:', e
101
 
 
102
 
@@ -720,7 +729,7 @@
103
 
         req._parse_response(self.data_recv[:self.request_length])
104
 
         # print 'recv Request:', req
105
 
 
106
 
-        self.data_recv = buffer(self.data_recv, self.request_length)
107
 
+        self.data_recv = self.data_recv[self.request_length:]
108
 
         self.request_length = 0
109
 
 
110
 
 
111
 
@@ -745,7 +754,7 @@
112
 
 
113
 
         e = estruct(display = self, binarydata = self.data_recv[:32])
114
 
 
115
 
-        self.data_recv = buffer(self.data_recv, 32)
116
 
+        self.data_recv = self.data_recv[32:]
117
 
 
118
 
         # Drop all requests having an error handler,
119
 
         # but which obviously succeded.
120
 
@@ -967,7 +976,7 @@
121
 
 
122
 
 
123
 
     def __init__(self, display, *args, **keys):
124
 
-        self._binary = apply(self._request.to_binary, args, keys)
125
 
+        self._binary = self._request.to_binary(*args, **keys)
126
 
         self._data = None
127
 
 
128
 
         # Don't bother about locking, since no other threads have
129
 
Index: python-xlib-0.14+20091101/Xlib/protocol/rq.py
130
 
===================================================================
131
 
--- python-xlib-0.14+20091101.orig/Xlib/protocol/rq.py  2013-10-11 14:19:21.117971349 -0400
132
 
+++ python-xlib-0.14+20091101/Xlib/protocol/rq.py       2013-10-11 14:20:03.905972445 -0400
133
 
@@ -16,21 +16,31 @@
134
 
 #    along with this program; if not, write to the Free Software
135
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
136
 
 
137
 
+import types
138
 
 
139
 
 # Standard modules
140
 
 import sys
141
 
 import traceback
142
 
 import struct
143
 
-import string
144
 
 from array import array
145
 
 import types
146
 
-import new
147
 
 
148
 
 # Xlib modules
149
 
 from Xlib import X
150
 
 from Xlib.support import lock
151
 
 
152
 
 
153
 
+_PY3 = sys.version[0] >= '3'
154
 
+
155
 
+# in Python 3, bytes are an actual array; in python 2, bytes are still
156
 
+# string-like, so in order to get an array element we need to call ord()
157
 
+if _PY3:
158
 
+    def _bytes_item(x):
159
 
+        return x
160
 
+else:
161
 
+    def _bytes_item(x):
162
 
+        return ord(x)
163
 
+
164
 
 class BadDataError(Exception): pass
165
 
 
166
 
 # These are struct codes, we know their byte sizes
167
 
@@ -52,10 +62,10 @@
168
 
 for c in 'bhil':
169
 
     size = array(c).itemsize
170
 
 
171
 
-    array_unsigned_codes[size] = string.upper(c)
172
 
+    array_unsigned_codes[size] = c.upper()
173
 
     try:
174
 
         struct_to_array_codes[signed_codes[size]] = c
175
 
-        struct_to_array_codes[unsigned_codes[size]] = string.upper(c)
176
 
+        struct_to_array_codes[unsigned_codes[size]] = c.upper()
177
 
     except KeyError:
178
 
         pass
179
 
 
180
 
@@ -135,7 +145,7 @@
181
 
 class Pad(Field):
182
 
     def __init__(self, size):
183
 
         self.size = size
184
 
-        self.value = '\0' * size
185
 
+        self.value = b'\0' * size
186
 
         self.structcode = '%dx' % size
187
 
         self.structvalues = 0
188
 
 
189
 
@@ -190,14 +200,14 @@
190
 
     structvalues = 1
191
 
 
192
 
     def calc_length(self, length):
193
 
-        return length / 4
194
 
+        return length // 4
195
 
 
196
 
 class ReplyLength(TotalLengthField):
197
 
     structcode = 'L'
198
 
     structvalues = 1
199
 
 
200
 
     def calc_length(self, length):
201
 
-        return (length - 32) / 4
202
 
+        return (length - 32) // 4
203
 
 
204
 
 
205
 
 class LengthOf(LengthField):
206
 
@@ -280,9 +290,9 @@
207
 
         self.codes = codes
208
 
 
209
 
     def check_value(self, value):
210
 
-        if type(value) is types.InstanceType:
211
 
+        try:
212
 
             return getattr(value, self.cast_function)()
213
 
-        else:
214
 
+        except AttributeError:
215
 
             return value
216
 
 
217
 
     def parse_value(self, value, display):
218
 
@@ -380,21 +390,32 @@
219
 
     def pack_value(self, val):
220
 
         slen = len(val)
221
 
 
222
 
+        if _PY3 and type(val) is str:
223
 
+            val = val.encode('UTF-8')
224
 
+
225
 
         if self.pad:
226
 
-            return val + '\0' * ((4 - slen % 4) % 4), slen, None
227
 
+            return val + b'\0' * ((4 - slen % 4) % 4), slen, None
228
 
         else:
229
 
             return val, slen, None
230
 
 
231
 
     def parse_binary_value(self, data, display, length, format):
232
 
         if length is None:
233
 
-            return str(data), ''
234
 
+            try:
235
 
+                return data.decode('UTF-8'), b''
236
 
+            except UnicodeDecodeError:
237
 
+                return data, b''
238
 
 
239
 
         if self.pad:
240
 
             slen = length + ((4 - length % 4) % 4)
241
 
         else:
242
 
             slen = length
243
 
 
244
 
-        return str(data[:length]), buffer(data, slen)
245
 
+        s = data[:length]
246
 
+        try:
247
 
+            s = s.decode('UTF-8')
248
 
+        except UnicodeDecodeError:
249
 
+            pass  # return as bytes
250
 
+        return s, data[slen:]
251
 
 
252
 
 
253
 
 class String16(ValueField):
254
 
@@ -406,30 +427,30 @@
255
 
 
256
 
     def pack_value(self, val):
257
 
         # Convert 8-byte string into 16-byte list
258
 
-        if type(val) is types.StringType:
259
 
-            val = map(lambda c: ord(c), val)
260
 
+        if type(val) is str:
261
 
+            val = list(map(lambda c: ord(c), val))
262
 
 
263
 
         slen = len(val)
264
 
 
265
 
         if self.pad:
266
 
-            pad = '\0\0' * (slen % 2)
267
 
+            pad = b'\0\0' * (slen % 2)
268
 
         else:
269
 
-            pad = ''
270
 
+            pad = b''
271
 
 
272
 
-        return apply(struct.pack, ('>' + 'H' * slen, ) + tuple(val)) + pad, slen, None
273
 
+        return struct.pack(*('>' + 'H' * slen, ) + tuple(val)) + pad, slen, None
274
 
 
275
 
     def parse_binary_value(self, data, display, length, format):
276
 
         if length == 'odd':
277
 
-            length = len(data) / 2 - 1
278
 
+            length = len(data) // 2 - 1
279
 
         elif length == 'even':
280
 
-            length = len(data) / 2
281
 
+            length = len(data) // 2
282
 
 
283
 
         if self.pad:
284
 
             slen = length + (length % 2)
285
 
         else:
286
 
             slen = length
287
 
 
288
 
-        return struct.unpack('>' + 'H' * length, data[:length * 2]), buffer(data, slen * 2)
289
 
+        return struct.unpack('>' + 'H' * length, data[:length * 2]), data[slen * 2:]
290
 
 
291
 
 
292
 
 
293
 
@@ -473,7 +494,7 @@
294
 
 
295
 
                     pos = pos + slen
296
 
 
297
 
-                data = buffer(data, pos)
298
 
+                data = data[pos:]
299
 
 
300
 
         else:
301
 
             ret = [None] * int(length)
302
 
@@ -498,10 +519,10 @@
303
 
 
304
 
                     pos = pos + slen
305
 
 
306
 
-                data = buffer(data, pos)
307
 
+                data = data[pos:]
308
 
 
309
 
         if self.pad:
310
 
-            data = buffer(data, len(data) % 4)
311
 
+            data = data[len(data) % 4:]
312
 
 
313
 
         return ret, data
314
 
 
315
 
@@ -515,11 +536,11 @@
316
 
             for v in val:
317
 
                 data.append(self.type.pack_value(v))
318
 
 
319
 
-            data = string.join(data, '')
320
 
+            data = b''.join(data)
321
 
 
322
 
         if self.pad:
323
 
             dlen = len(data)
324
 
-            data = data + '\0' * ((4 - dlen % 4) % 4)
325
 
+            data = data + b'\0' * ((4 - dlen % 4) % 4)
326
 
 
327
 
         return data, len(val), None
328
 
 
329
 
@@ -562,7 +583,7 @@
330
 
             if self.type.parse_value is not None:
331
 
                 v = self.type.parse_value(v, display)
332
 
 
333
 
-            return v, buffer(data, slen)
334
 
+            return v, data[slen:]
335
 
 
336
 
     def parse_value(self, val, display):
337
 
         if self.type.parse_value is None:
338
 
@@ -581,10 +602,10 @@
339
 
         if self.type.structcode is None:
340
 
             return val
341
 
 
342
 
-        if type(val) is types.TupleType:
343
 
+        if type(val) is tuple:
344
 
             return val
345
 
 
346
 
-        if type(val) is types.DictType:
347
 
+        if type(val) is dict:
348
 
             data = val
349
 
         elif isinstance(val, DictWrapper):
350
 
             data = val._data
351
 
@@ -604,24 +625,31 @@
352
 
 
353
 
     def parse_binary_value(self, data, display, length, format):
354
 
         if length is None:
355
 
-            length = len(data) / (format / 8)
356
 
+            length = len(data) // (format // 8)
357
 
         else:
358
 
             length = int(length)
359
 
 
360
 
         if format == 0:
361
 
             ret = None
362
 
+            return ret, data
363
 
 
364
 
         elif format == 8:
365
 
-            ret = (8, str(data[:length]))
366
 
-            data = buffer(data, length + ((4 - length % 4) % 4))
367
 
+            ret = (8, data[:length])
368
 
+            data = data[length + ((4 - length % 4) % 4):]
369
 
 
370
 
         elif format == 16:
371
 
-            ret = (16, array(array_unsigned_codes[2], str(data[:2 * length])))
372
 
-            data = buffer(data, 2 * (length + length % 2))
373
 
+            ret = (16, array(array_unsigned_codes[2], data[:2 * length]))
374
 
+            data = data[2 * (length + length % 2):]
375
 
 
376
 
         elif format == 32:
377
 
-            ret = (32, array(array_unsigned_codes[4], str(data[:4 * length])))
378
 
-            data = buffer(data, 4 * length)
379
 
+            ret = (32, array(array_unsigned_codes[4], data[:4 * length]))
380
 
+            data = data[4 * length:]
381
 
+
382
 
+        if type(ret[1]) is bytes:
383
 
+            try:
384
 
+                ret = (ret[0], ret[1].decode('UTF-8'))
385
 
+            except UnicodeDecodeError:
386
 
+                pass  # return as bytes
387
 
 
388
 
         return ret, data
389
 
 
390
 
@@ -631,8 +659,11 @@
391
 
         if fmt not in (8, 16, 32):
392
 
             raise BadDataError('Invalid property data format %d' % fmt)
393
 
 
394
 
-        if type(val) is types.StringType:
395
 
-            size = fmt / 8
396
 
+        if _PY3 and type(val) is str:
397
 
+            val = val.encode('UTF-8')
398
 
+
399
 
+        if type(val) is bytes:
400
 
+            size = fmt // 8
401
 
             vlen = len(val)
402
 
             if vlen % size:
403
 
                 vlen = vlen - vlen % size
404
 
@@ -640,18 +671,18 @@
405
 
             else:
406
 
                 data = val
407
 
 
408
 
-            dlen = vlen / size
409
 
+            dlen = vlen // size
410
 
 
411
 
         else:
412
 
-            if type(val) is types.TupleType:
413
 
+            if type(val) is tuple:
414
 
                 val = list(val)
415
 
 
416
 
-            size = fmt / 8
417
 
+            size = fmt // 8
418
 
             data =  array(array_unsigned_codes[size], val).tostring()
419
 
             dlen = len(val)
420
 
 
421
 
         dl = len(data)
422
 
-        data = data + '\0' * ((4 - dl % 4) % 4)
423
 
+        data = data + b'\0' * ((4 - dl % 4) % 4)
424
 
 
425
 
         return data, dlen, fmt
426
 
 
427
 
@@ -663,7 +694,7 @@
428
 
 
429
 
     def parse_binary_value(self, data, display, length, format):
430
 
         return PropertyData.parse_binary_value(self, data, display,
431
 
-                                               self.size / (format / 8), format)
432
 
+                                               self.size // (format // 8), format)
433
 
 
434
 
     def pack_value(self, value):
435
 
         data, dlen, fmt = PropertyData.pack_value(self, value)
436
 
@@ -694,13 +725,13 @@
437
 
 
438
 
     def pack_value(self, arg, keys):
439
 
         mask = 0
440
 
-        data = ''
441
 
+        data = b''
442
 
 
443
 
         if arg == self.default:
444
 
             arg = keys
445
 
 
446
 
         for field, flag in self.fields:
447
 
-            if arg.has_key(field.name):
448
 
+            if field.name in arg:
449
 
                 mask = mask | flag
450
 
 
451
 
                 val = arg[field.name]
452
 
@@ -708,7 +739,7 @@
453
 
                     val = field.check_value(val)
454
 
 
455
 
                 d = struct.pack('=' + field.structcode, val)
456
 
-                data = data + d + '\0' * (4 - len(d))
457
 
+                data = data + d + b'\0' * (4 - len(d))
458
 
 
459
 
         return struct.pack(self.maskcode, mask) + data, None, None
460
 
 
461
 
@@ -716,7 +747,7 @@
462
 
         r = {}
463
 
 
464
 
         mask = int(struct.unpack(self.maskcode, data[:self.maskcodelen])[0])
465
 
-        data = buffer(data, self.maskcodelen)
466
 
+        data = data[self.maskcodelen:]
467
 
 
468
 
         for field, flag in self.fields:
469
 
             if mask & flag:
470
 
@@ -733,7 +764,7 @@
471
 
                     vals, d = field.parse_binary_value(data[:4], display, None, None)
472
 
 
473
 
                 r[field.name] = vals
474
 
-                data = buffer(data, 4)
475
 
+                data = data[4:]
476
 
 
477
 
         return DictWrapper(r), data
478
 
 
479
 
@@ -747,13 +778,13 @@
480
 
         else:
481
 
             dlen = 4 * length * format
482
 
 
483
 
-        a = array(array_unsigned_codes[4], str(data[:dlen]))
484
 
+        a = array(array_unsigned_codes[4], data[:dlen])
485
 
 
486
 
         ret = []
487
 
         for i in range(0, len(a), format):
488
 
             ret.append(a[i : i + format])
489
 
 
490
 
-        return ret, buffer(data, dlen)
491
 
+        return ret, data[dlen:]
492
 
 
493
 
     def pack_value(self, value):
494
 
         keycodes = 0
495
 
@@ -775,13 +806,13 @@
496
 
     structcode = None
497
 
 
498
 
     def parse_binary_value(self, data, display, length, format):
499
 
-        a = array(array_unsigned_codes[1], str(data[:8 * format]))
500
 
+        a = array(array_unsigned_codes[1], data[:8 * format])
501
 
 
502
 
         ret = []
503
 
         for i in range(0, 8):
504
 
             ret.append(a[i * format : (i + 1) * format])
505
 
 
506
 
-        return ret, buffer(data, 8 * format)
507
 
+        return ret, data[8 * format:]
508
 
 
509
 
     def pack_value(self, value):
510
 
         if len(value) != 8:
511
 
@@ -811,11 +842,11 @@
512
 
         return value._binary, None, None
513
 
 
514
 
     def parse_binary_value(self, data, display, length, format):
515
 
-        import event
516
 
+        from Xlib.protocol import event
517
 
 
518
 
-        estruct = display.event_classes.get(ord(data[0]) & 0x7f, event.AnyEvent)
519
 
+        estruct = display.event_classes.get(_bytes_item(data[0]) & 0x7f, event.AnyEvent)
520
 
 
521
 
-        return estruct(display = display, binarydata = data[:32]), buffer(data, 32)
522
 
+        return estruct(display = display, binarydata = data[:32]), data[32:]
523
 
 
524
 
 
525
 
 #
526
 
@@ -856,11 +887,22 @@
527
 
     structcode = None
528
 
 
529
 
     def pack_value(self, val):
530
 
-        return chr(len(val)) + val
531
 
+        if type(val) is not bytes:
532
 
+            val = val.encode('UTF-8')
533
 
+        if _PY3:
534
 
+            val = bytes([len(val)]) + val
535
 
+        else:
536
 
+            val = chr(len(val)) + val
537
 
+        return val
538
 
 
539
 
     def parse_binary(self, data, display):
540
 
-        slen = ord(data[0]) + 1
541
 
-        return data[1:slen], buffer(data, slen)
542
 
+        slen = _bytes_item(data[0]) + 1
543
 
+        s = data[1:slen]
544
 
+        try:
545
 
+            s = s.decode('UTF-8')
546
 
+        except UnicodeDecodeError:
547
 
+            pass  # return as bytes
548
 
+        return s, data[slen:]
549
 
 
550
 
 Str = StrClass()
551
 
 
552
 
@@ -979,6 +1021,7 @@
553
 
         # static fields.  First argument is the structcode, the
554
 
         # remaining are values.
555
 
 
556
 
+
557
 
         pack_args = ['"%s"' % self.static_codes]
558
 
 
559
 
         i = 0
560
 
@@ -1028,9 +1071,9 @@
561
 
 
562
 
                     if f.check_value is not None:
563
 
                         code = code + ('  %s = self.static_fields[%d].check_value(%s)\n'
564
 
-                                       % (string.join(a, ', '), i, f.name))
565
 
+                                       % (', '.join(a), i, f.name))
566
 
                     else:
567
 
-                        code = code + '  %s = %s\n' % (string.join(a, ', '), f.name)
568
 
+                        code = code + '  %s = %s\n' % (', '.join(a), f.name)
569
 
 
570
 
                     pack_args = pack_args + a
571
 
 
572
 
@@ -1043,14 +1086,13 @@
573
 
 
574
 
             i = i + 1
575
 
 
576
 
-
577
 
         # Construct call to struct.pack
578
 
-        pack = 'struct.pack(%s)' % string.join(pack_args, ', ')
579
 
+        pack = 'struct.pack(%s)' % ', '.join(pack_args)
580
 
 
581
 
         # If there are any varfields, we append the packed strings to build
582
 
         # the resulting binary value
583
 
         if self.var_fields:
584
 
-            code = code + '  return %s + %s\n' % (pack, string.join(joins, ' + '))
585
 
+            code = code + '  return %s + %s\n' % (pack, ' + '.join(joins))
586
 
 
587
 
         # If there's only static fields, return the packed value
588
 
         else:
589
 
@@ -1070,7 +1112,7 @@
590
 
             args.append('**_keyword_args')
591
 
 
592
 
         # Add function header
593
 
-        code = 'def to_binary(self, %s):\n' % string.join(args, ', ') + code
594
 
+        code = 'def to_binary(self, %s):\n' % ', '.join(args) + code
595
 
 
596
 
         # self._pack_code = code
597
 
 
598
 
@@ -1088,11 +1130,12 @@
599
 
         # memory leak isn't that serious.  Besides, Python 2.0 has
600
 
         # real garbage collect.
601
 
 
602
 
-        exec code
603
 
-        self.to_binary = new.instancemethod(to_binary, self, self.__class__)
604
 
+        g = globals().copy()
605
 
+        exec(code, g)
606
 
+        self.to_binary = types.MethodType(g['to_binary'], self)
607
 
 
608
 
         # Finally call it manually
609
 
-        return apply(self.to_binary, varargs, keys)
610
 
+        return self.to_binary(*varargs, **keys)
611
 
 
612
 
 
613
 
     def pack_value(self, value):
614
 
@@ -1103,12 +1146,12 @@
615
 
 
616
 
         """
617
 
 
618
 
-        if type(value) is types.TupleType:
619
 
-            return apply(self.to_binary, value, {})
620
 
-        elif type(value) is types.DictionaryType:
621
 
-            return apply(self.to_binary, (), value)
622
 
+        if type(value) is tuple:
623
 
+            return self.to_binary(*value, **{})
624
 
+        elif type(value) is dict:
625
 
+            return self.to_binary(*(), **value)
626
 
         elif isinstance(value, DictWrapper):
627
 
-            return apply(self.to_binary, (), value._data)
628
 
+            return self.to_binary(*(), **value._data)
629
 
         else:
630
 
             raise BadDataError('%s is not a tuple or a list' % (value))
631
 
 
632
 
@@ -1173,8 +1216,9 @@
633
 
 
634
 
         # Finally, compile function as for to_binary.
635
 
 
636
 
-        exec code
637
 
-        self.parse_value = new.instancemethod(parse_value, self, self.__class__)
638
 
+        g = globals().copy()
639
 
+        exec(code, g)
640
 
+        self.parse_value = types.MethodType(g['parse_value'], self)
641
 
 
642
 
         # Call it manually
643
 
         return self.parse_value(val, display, rawdict)
644
 
@@ -1249,7 +1293,7 @@
645
 
             fno = fno + 1
646
 
             vno = vno + f.structvalues
647
 
 
648
 
-        code = code + '  data = buffer(data, %d)\n' % self.static_size
649
 
+        code = code + '  data = data[%d:]\n' % self.static_size
650
 
 
651
 
         # Call parse_binary_value for each var_field, passing the
652
 
         # length and format values from the unpacked val.
653
 
@@ -1273,8 +1317,9 @@
654
 
 
655
 
         # Finally, compile function as for to_binary.
656
 
 
657
 
-        exec code
658
 
-        self.parse_binary = new.instancemethod(parse_binary, self, self.__class__)
659
 
+        g = globals().copy()
660
 
+        exec(code, g)
661
 
+        self.parse_binary = types.MethodType(g['parse_binary'], self)
662
 
 
663
 
         # Call it manually
664
 
         return self.parse_binary(data, display, rawdict)
665
 
@@ -1286,46 +1331,49 @@
666
 
                               String8('string', pad = 0) )
667
 
 
668
 
     def pack_value(self, value):
669
 
-        data = ''
670
 
+        data = b''
671
 
         args = {}
672
 
 
673
 
         for v in value:
674
 
             # Let values be simple strings, meaning a delta of 0
675
 
-            if type(v) is types.StringType:
676
 
+            if _PY3 and type(v) is str:
677
 
+                v = v.encode('UTF-8')
678
 
+
679
 
+            if type(v) is bytes:
680
 
                 v = (0, v)
681
 
 
682
 
             # A tuple, it should be (delta, string)
683
 
             # Encode it as one or more textitems
684
 
 
685
 
-            if type(v) in (types.TupleType, types.DictType) or \
686
 
+            if type(v) in (tuple, dict) or \
687
 
                isinstance(v, DictWrapper):
688
 
 
689
 
-                if type(v) is types.TupleType:
690
 
-                    delta, str = v
691
 
+                if type(v) is tuple:
692
 
+                    delta, s = v
693
 
                 else:
694
 
                     delta = v['delta']
695
 
-                    str = v['string']
696
 
+                    s = v['string']
697
 
 
698
 
-                while delta or str:
699
 
+                while delta or s:
700
 
                     args['delta'] = delta
701
 
-                    args['string'] = str[:254]
702
 
+                    args['string'] = s[:254]
703
 
 
704
 
-                    data = data + apply(self.string_textitem.to_binary, (), args)
705
 
+                    data = data + self.string_textitem.to_binary(*(), **args)
706
 
 
707
 
                     delta = 0
708
 
-                    str = str[254:]
709
 
+                    s = s[254:]
710
 
 
711
 
             # Else an integer, i.e. a font change
712
 
             else:
713
 
                 # Use fontable cast function if instance
714
 
-                if type(v) is types.InstanceType:
715
 
+                if hasattr(v, '__fontable__'):
716
 
                     v = v.__fontable__()
717
 
 
718
 
                 data = data + struct.pack('>BL', 255, v)
719
 
 
720
 
         # Pad out to four byte length
721
 
         dlen = len(data)
722
 
-        return data + '\0' * ((4 - dlen % 4) % 4), None, None
723
 
+        return data + b'\0' * ((4 - dlen % 4) % 4), None, None
724
 
 
725
 
     def parse_binary_value(self, data, display, length, format):
726
 
         values = []
727
 
@@ -1334,20 +1382,20 @@
728
 
                 break
729
 
 
730
 
             # font change
731
 
-            if ord(data[0]) == 255:
732
 
-                values.append(struct.unpack('>L', str(data[1:5]))[0])
733
 
-                data = buffer(data, 5)
734
 
+            if _bytes_item(data[0]) == 255:
735
 
+                values.append(struct.unpack('>L', data[1:5])[0])
736
 
+                data = data[5:]
737
 
 
738
 
             # skip null strings
739
 
-            elif ord(data[0]) == 0 and ord(data[1]) == 0:
740
 
-                data = buffer(data, 2)
741
 
+            elif _bytes_item(data[0]) == 0 and _bytes_item(data[1]) == 0:
742
 
+                data = data[2:]
743
 
 
744
 
             # string with delta
745
 
             else:
746
 
                 v, data = self.string_textitem.parse_binary(data, display)
747
 
                 values.append(v)
748
 
 
749
 
-        return values, ''
750
 
+        return values, b''
751
 
 
752
 
 
753
 
 
754
 
@@ -1358,7 +1406,7 @@
755
 
 
756
 
 
757
 
 
758
 
-class GetAttrData:
759
 
+class GetAttrData(object):
760
 
     def __getattr__(self, attr):
761
 
         try:
762
 
             if self._data:
763
 
@@ -1393,17 +1441,19 @@
764
 
     def __repr__(self):
765
 
         return '%s(%s)' % (self.__class__, repr(self._data))
766
 
 
767
 
-    def __cmp__(self, other):
768
 
+    def __eq__(self, other):
769
 
         if isinstance(other, DictWrapper):
770
 
-            return cmp(self._data, other._data)
771
 
+            return self._data == other._data
772
 
         else:
773
 
-            return cmp(self._data, other)
774
 
+            return self._data == other
775
 
 
776
 
+    def __ne__(self, other):
777
 
+        return not self.__eq__(other)
778
 
 
779
 
 class Request:
780
 
     def __init__(self, display, onerror = None, *args, **keys):
781
 
         self._errorhandler = onerror
782
 
-        self._binary = apply(self._request.to_binary, args, keys)
783
 
+        self._binary = self._request.to_binary(*args, **keys)
784
 
         self._serial = None
785
 
         display.send_request(self, onerror is not None)
786
 
 
787
 
@@ -1416,7 +1466,7 @@
788
 
 class ReplyRequest(GetAttrData):
789
 
     def __init__(self, display, defer = 0, *args, **keys):
790
 
         self._display = display
791
 
-        self._binary = apply(self._request.to_binary, args, keys)
792
 
+        self._binary = self._request.to_binary(*args, **keys)
793
 
         self._serial = None
794
 
         self._data = None
795
 
         self._error = None
796
 
@@ -1478,7 +1528,7 @@
797
 
 
798
 
             keys['sequence_number'] = 0
799
 
 
800
 
-            self._binary = apply(self._fields.to_binary, (), keys)
801
 
+            self._binary = self._fields.to_binary(*(), **keys)
802
 
 
803
 
             keys['send_event'] = 0
804
 
             self._data = keys
805
 
@@ -1492,16 +1542,15 @@
806
 
                 val = val | 0x80
807
 
             kwlist.append('%s = %s' % (kw, repr(val)))
808
 
 
809
 
-        kws = string.join(kwlist, ', ')
810
 
+        kws = ', '.join(kwlist)
811
 
         return '%s(%s)' % (self.__class__, kws)
812
 
 
813
 
-    def __cmp__(self, other):
814
 
+    def __eq__(self, other):
815
 
         if isinstance(other, Event):
816
 
-            return cmp(self._data, other._data)
817
 
+            return self._data == other._data
818
 
         else:
819
 
             return cmp(self._data, other)
820
 
 
821
 
-
822
 
 def call_error_handler(handler, error, request):
823
 
     try:
824
 
         return handler(error, request)
825
 
Index: python-xlib-0.14+20091101/Xlib/rdb.py
826
 
===================================================================
827
 
--- python-xlib-0.14+20091101.orig/Xlib/rdb.py  2013-10-11 14:19:21.117971349 -0400
828
 
+++ python-xlib-0.14+20091101/Xlib/rdb.py       2013-10-11 14:19:21.089971348 -0400
829
 
@@ -22,13 +22,12 @@
830
 
 
831
 
 
832
 
 # Standard modules
833
 
-import string
834
 
-import types
835
 
 import re
836
 
 import sys
837
 
+import functools
838
 
 
839
 
 # Xlib modules
840
 
-from support import lock
841
 
+from Xlib.support import lock
842
 
 
843
 
 # Set up a few regexpes for parsing string representation of resources
844
 
 
845
 
@@ -69,7 +68,7 @@
846
 
 
847
 
         """
848
 
 
849
 
-        if type(file) is types.StringType:
850
 
+        if type(file) is str:
851
 
             file = open(file, 'r')
852
 
 
853
 
         self.insert_string(file.read())
854
 
@@ -84,7 +83,7 @@
855
 
         """
856
 
 
857
 
         # First split string into lines
858
 
-        lines = string.split(data, '\n')
859
 
+        lines = data.split('\n')
860
 
 
861
 
         while lines:
862
 
             line = lines[0]
863
 
@@ -122,15 +121,15 @@
864
 
             for i in range(1, len(splits), 2):
865
 
                 s = splits[i]
866
 
                 if len(s) == 3:
867
 
-                    splits[i] = chr(string.atoi(s, 8))
868
 
+                    splits[i] = chr(int(s, 8))
869
 
                 elif s == 'n':
870
 
                     splits[i] = '\n'
871
 
 
872
 
             # strip the last value part to get rid of any
873
 
             # unescaped blanks
874
 
-            splits[-1] = string.rstrip(splits[-1])
875
 
+            splits[-1] = splits[-1].rstrip()
876
 
 
877
 
-            value = string.join(splits, '')
878
 
+            value = ''.join(splits)
879
 
 
880
 
             self.insert(res, value)
881
 
 
882
 
@@ -172,7 +171,7 @@
883
 
         for i in range(1, len(parts), 2):
884
 
 
885
 
             # Create a new mapping/value group
886
 
-            if not db.has_key(parts[i - 1]):
887
 
+            if parts[i - 1] not in db:
888
 
                 db[parts[i - 1]] = ({}, {})
889
 
 
890
 
             # Use second mapping if a loose binding, first otherwise
891
 
@@ -182,24 +181,25 @@
892
 
                 db = db[parts[i - 1]][0]
893
 
 
894
 
         # Insert value into the derived db
895
 
-        if db.has_key(parts[-1]):
896
 
+        if parts[-1] in db:
897
 
             db[parts[-1]] = db[parts[-1]][:2] + (value, )
898
 
         else:
899
 
             db[parts[-1]] = ({}, {}, value)
900
 
 
901
 
         self.lock.release()
902
 
 
903
 
-    def __getitem__(self, (name, cls)):
904
 
+    def __getitem__(self, nc):
905
 
         """db[name, class]
906
 
 
907
 
         Return the value matching the resource identified by NAME and
908
 
         CLASS.  If no match is found, KeyError is raised.
909
 
         """
910
 
+        name, cls = nc
911
 
 
912
 
         # Split name and class into their parts
913
 
 
914
 
-        namep = string.split(name, '.')
915
 
-        clsp = string.split(cls, '.')
916
 
+        namep = name.split('.')
917
 
+        clsp = cls.split('.')
918
 
 
919
 
         # It is an error for name and class to have different number
920
 
         # of parts
921
 
@@ -218,13 +218,13 @@
922
 
 
923
 
             # Precedence order: name -> class -> ?
924
 
 
925
 
-            if self.db.has_key(namep[0]):
926
 
+            if namep[0] in self.db:
927
 
                 bin_insert(matches, _Match((NAME_MATCH, ), self.db[namep[0]]))
928
 
 
929
 
-            if self.db.has_key(clsp[0]):
930
 
+            if clsp[0] in self.db:
931
 
                 bin_insert(matches, _Match((CLASS_MATCH, ), self.db[clsp[0]]))
932
 
 
933
 
-            if self.db.has_key('?'):
934
 
+            if '?' in self.db:
935
 
                 bin_insert(matches, _Match((WILD_MATCH, ), self.db['?']))
936
 
 
937
 
 
938
 
@@ -240,7 +240,7 @@
939
 
 
940
 
             # Special case for resources which begins with a loose
941
 
             # binding, e.g. '*foo.bar'
942
 
-            if self.db.has_key(''):
943
 
+            if '' in self.db:
944
 
                 bin_insert(matches, _Match((), self.db[''][1]))
945
 
 
946
 
 
947
 
@@ -376,11 +376,12 @@
948
 
         return argv
949
 
 
950
 
 
951
 
+@functools.total_ordering
952
 
 class _Match:
953
 
     def __init__(self, path, dbs):
954
 
         self.path = path
955
 
 
956
 
-        if type(dbs) is types.TupleType:
957
 
+        if type(dbs) is tuple:
958
 
             self.skip = 0
959
 
             self.group = dbs
960
 
 
961
 
@@ -388,22 +389,25 @@
962
 
             self.skip = 1
963
 
             self.db = dbs
964
 
 
965
 
-    def __cmp__(self, other):
966
 
-        return cmp(self.path, other.path)
967
 
+    def __eq__(self, other):
968
 
+        return self.path == other.path
969
 
+
970
 
+    def __lt__(self, other):
971
 
+        return self.path < other.path
972
 
 
973
 
     def match_length(self):
974
 
         return len(self.path)
975
 
 
976
 
     def match(self, part, score):
977
 
         if self.skip:
978
 
-            if self.db.has_key(part):
979
 
+            if part in self.db:
980
 
                 return _Match(self.path + (score, ), self.db[part])
981
 
             else:
982
 
                 return None
983
 
         else:
984
 
-            if self.group[0].has_key(part):
985
 
+            if part in self.group[0]:
986
 
                 return _Match(self.path + (score, ), self.group[0][part])
987
 
-            elif self.group[1].has_key(part):
988
 
+            elif part in self.group[1]:
989
 
                 return _Match(self.path + (score + 1, ), self.group[1][part])
990
 
             else:
991
 
                 return None
992
 
@@ -460,7 +464,7 @@
993
 
     upper = len(list) - 1
994
 
 
995
 
     while lower <= upper:
996
 
-        center = (lower + upper) / 2
997
 
+        center = (lower + upper) // 2
998
 
         if element < list[center]:
999
 
             upper = center - 1
1000
 
         elif element > list[center]:
1001
 
@@ -482,7 +486,7 @@
1002
 
     for comp, group in src.items():
1003
 
 
1004
 
         # DEST already contains this component, update it
1005
 
-        if dest.has_key(comp):
1006
 
+        if comp in dest:
1007
 
 
1008
 
             # Update tight and loose binding databases
1009
 
             update_db(dest[comp][0], group[0])
1010
 
@@ -536,7 +540,7 @@
1011
 
                       ('\000', '\\000'),
1012
 
                       ('\n', '\\n')):
1013
 
 
1014
 
-        value = string.replace(value, char, esc)
1015
 
+        value = value.replace(char, esc)
1016
 
 
1017
 
     # If first or last character is space or tab, escape them.
1018
 
     if value[0] in ' \t':
1019
 
Index: python-xlib-0.14+20091101/Xlib/support/unix_connect.py
1020
 
===================================================================
1021
 
--- python-xlib-0.14+20091101.orig/Xlib/support/unix_connect.py 2013-10-11 14:19:21.117971349 -0400
1022
 
+++ python-xlib-0.14+20091101/Xlib/support/unix_connect.py      2013-10-11 14:19:21.089971348 -0400
1023
 
@@ -17,7 +17,6 @@
1024
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1025
 
 
1026
 
 import re
1027
 
-import string
1028
 
 import os
1029
 
 import platform
1030
 
 import socket
1031
 
@@ -88,7 +87,7 @@
1032
 
         else:
1033
 
             s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
1034
 
             s.connect('/tmp/.X11-unix/X%d' % dno)
1035
 
-    except socket.error, val:
1036
 
+    except socket.error as val:
1037
 
         raise error.DisplayConnectionError(dname, str(val))
1038
 
 
1039
 
     # Make sure that the connection isn't inherited in child processes
1040
 
@@ -108,8 +107,8 @@
1041
 
 
1042
 
         # Convert the prettyprinted IP number into 4-octet string.
1043
 
         # Sometimes these modules are too damn smart...
1044
 
-        octets = string.split(sock.getpeername()[0], '.')
1045
 
-        addr = string.join(map(lambda x: chr(int(x)), octets), '')
1046
 
+        octets = sock.getpeername()[0].split('.')
1047
 
+        addr = ''.join(map(lambda x: chr(int(x)), octets))
1048
 
     else:
1049
 
         family = xauth.FamilyLocal
1050
 
         addr = socket.gethostname()
1051
 
@@ -145,9 +144,9 @@
1052
 
         #      DISPLAY SCHEME COOKIE
1053
 
         # We're interested in the two last parts for the
1054
 
         # connection establishment
1055
 
-        lines = string.split(data, '\n')
1056
 
+        lines = data.split('\n')
1057
 
         if len(lines) >= 1:
1058
 
-            parts = string.split(lines[0], None, 2)
1059
 
+            parts = lines[0].split(None, 2)
1060
 
             if len(parts) == 3:
1061
 
                 auth_name = parts[1]
1062
 
                 hexauth = parts[2]
1063
 
@@ -155,7 +154,7 @@
1064
 
 
1065
 
                 # Translate hexcode into binary
1066
 
                 for i in range(0, len(hexauth), 2):
1067
 
-                    auth = auth + chr(string.atoi(hexauth[i:i+2], 16))
1068
 
+                    auth = auth + chr(int(hexauth[i:i+2], 16))
1069
 
 
1070
 
                 auth_data = auth
1071
 
     except os.error:
1072
 
@@ -167,7 +166,7 @@
1073
 
        # There might be more ways to spell 127.0.0.1 but
1074
 
        # 'localhost', yet this code fixes a the case of
1075
 
        # OpenSSH tunneling X.
1076
 
-       return get_auth('unix:%d' % dno, 'unix', dno)
1077
 
+        return get_auth('unix:%d' % dno, 'unix', dno)
1078
 
 
1079
 
     return auth_name, auth_data
1080
 
 
1081
 
Index: python-xlib-0.14+20091101/Xlib/support/vms_connect.py
1082
 
===================================================================
1083
 
--- python-xlib-0.14+20091101.orig/Xlib/support/vms_connect.py  2013-10-11 14:19:21.117971349 -0400
1084
 
+++ python-xlib-0.14+20091101/Xlib/support/vms_connect.py       2013-10-11 14:19:21.089971348 -0400
1085
 
@@ -60,7 +60,7 @@
1086
 
         s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
1087
 
         s.connect((host, 6000 + dno))
1088
 
 
1089
 
-    except socket.error, val:
1090
 
+    except socket.error as val:
1091
 
         raise error.DisplayConnectionError(dname, str(val))
1092
 
 
1093
 
     return s
1094
 
Index: python-xlib-0.14+20091101/Xlib/xauth.py
1095
 
===================================================================
1096
 
--- python-xlib-0.14+20091101.orig/Xlib/xauth.py        2013-10-11 14:19:21.117971349 -0400
1097
 
+++ python-xlib-0.14+20091101/Xlib/xauth.py     2013-10-11 14:19:21.089971348 -0400
1098
 
@@ -40,7 +40,7 @@
1099
 
 
1100
 
         try:
1101
 
             raw = open(filename, 'rb').read()
1102
 
-        except IOError, err:
1103
 
+        except IOError as err:
1104
 
             raise error.XauthError('~/.Xauthority: %s' % err)
1105
 
 
1106
 
         self.entries = []
1107
 
@@ -82,12 +82,12 @@
1108
 
                     break
1109
 
 
1110
 
                 self.entries.append((family, addr, num, name, data))
1111
 
-        except struct.error, e:
1112
 
-            print "Xlib.xauth: warning, failed to parse part of xauthority file (%s), aborting all further parsing" % filename
1113
 
+        except struct.error as e:
1114
 
+            print ("Xlib.xauth: warning, failed to parse part of xauthority file (%s), aborting all further parsing" % filename)
1115
 
             #pass
1116
 
 
1117
 
         if len(self.entries) == 0:
1118
 
-            print "Xlib.xauth: warning, no xauthority details available"
1119
 
+            print ("Xlib.xauth: warning, no xauthority details available")
1120
 
             # raise an error?  this should get partially caught by the XNoAuthError in get_best_auth..
1121
 
 
1122
 
     def __len__(self):
1123
 
Index: python-xlib-0.14+20091101/Xlib/xobject/cursor.py
1124
 
===================================================================
1125
 
--- python-xlib-0.14+20091101.orig/Xlib/xobject/cursor.py       2013-10-11 14:19:21.117971349 -0400
1126
 
+++ python-xlib-0.14+20091101/Xlib/xobject/cursor.py    2013-10-11 14:19:21.089971348 -0400
1127
 
@@ -17,8 +17,7 @@
1128
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1129
 
 
1130
 
 from Xlib.protocol import request
1131
 
-
1132
 
-import resource
1133
 
+from Xlib.xobject import resource
1134
 
 
1135
 
 class Cursor(resource.Resource):
1136
 
     __cursor__ = resource.Resource.__resource__
1137
 
@@ -29,9 +28,9 @@
1138
 
                            cursor = self.id)
1139
 
         self.display.free_resource_id(self.id)
1140
 
 
1141
 
-    def recolor(self, (fore_red, fore_green, fore_blue),
1142
 
-                (back_red, back_green, back_blue), onerror = None):
1143
 
-
1144
 
+    def recolor(self, f_rgb, b_rgb, onerror = None):
1145
 
+        back_red, back_green, back_blue = b_rgb
1146
 
+        fore_red, fore_green, fore_blue = f_rgb
1147
 
         request.RecolorCursor(display = self.display,
1148
 
                               onerror = onerror,
1149
 
                               cursor = self.id,
1150
 
Index: python-xlib-0.14+20091101/Xlib/xobject/drawable.py
1151
 
===================================================================
1152
 
--- python-xlib-0.14+20091101.orig/Xlib/xobject/drawable.py     2013-10-11 14:19:21.117971349 -0400
1153
 
+++ python-xlib-0.14+20091101/Xlib/xobject/drawable.py  2013-10-11 14:21:48.317975118 -0400
1154
 
@@ -16,19 +16,12 @@
1155
 
 #    along with this program; if not, write to the Free Software
1156
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1157
 
 
1158
 
-import string
1159
 
 
1160
 
 from Xlib import X, Xatom, Xutil
1161
 
 from Xlib.protocol import request, rq
1162
 
 
1163
 
 # Other X resource objects
1164
 
-import resource
1165
 
-import colormap
1166
 
-import cursor
1167
 
-import fontable
1168
 
-
1169
 
-# Inter-client communication conventions
1170
 
-import icccm
1171
 
+from Xlib.xobject import resource, colormap, cursor, fontable, icccm
1172
 
 
1173
 
 class Drawable(resource.Resource):
1174
 
     __drawable__ = resource.Resource.__resource__
1175
 
@@ -231,11 +224,11 @@
1176
 
             unit = self.display.info.bitmap_format_scanline_unit
1177
 
             stride = roundup(width * unit, pad) >> 3
1178
 
         else:
1179
 
-            raise ValueError, 'Unknown data format'
1180
 
+            raise ValueError('Unknown data format')
1181
 
 
1182
 
         maxlen = (self.display.info.max_request_length << 2) \
1183
 
                  - request.PutImage._request.static_size
1184
 
-        split = maxlen / stride
1185
 
+        split = maxlen // stride
1186
 
 
1187
 
         x1 = 0
1188
 
         x2 = width
1189
 
@@ -461,7 +454,7 @@
1190
 
             val = prop.value
1191
 
             if prop.bytes_after:
1192
 
                 prop = self.get_property(property, type, sizehint,
1193
 
-                                         prop.bytes_after / 4 + 1)
1194
 
+                                         prop.bytes_after // 4 + 1)
1195
 
                 val = val + prop.value
1196
 
 
1197
 
             prop.value = val
1198
 
@@ -668,7 +661,7 @@
1199
 
         if d is None or d.format != 8:
1200
 
             return None
1201
 
         else:
1202
 
-            parts = string.split(d.value, '\0')
1203
 
+            parts = d.value.split('\0')
1204
 
             if len(parts) < 2:
1205
 
                 return None
1206
 
             else:
1207
 
@@ -765,7 +758,7 @@
1208
 
     # Returns a DictWrapper, or None
1209
 
 
1210
 
     def _get_struct_prop(self, pname, ptype, pstruct):
1211
 
-        r = self.get_property(pname, ptype, 0, pstruct.static_size / 4)
1212
 
+        r = self.get_property(pname, ptype, 0, pstruct.static_size // 4)
1213
 
         if r and r.format == 32:
1214
 
             value = r.value.tostring()
1215
 
             if len(value) == pstruct.static_size:
1216
 
@@ -784,7 +777,7 @@
1217
 
         else:
1218
 
             keys.update(hints)
1219
 
 
1220
 
-        value = apply(pstruct.to_binary, (), keys)
1221
 
+        value = pstruct.to_binary(*(), **keys)
1222
 
 
1223
 
         self.change_property(pname, ptype, 32, value, onerror = onerror)
1224
 
 
1225
 
@@ -800,9 +793,10 @@
1226
 
         self.display.free_resource_id(self.id)
1227
 
 
1228
 
     def create_cursor(self, mask,
1229
 
-                      (fore_red, fore_green, fore_blue),
1230
 
-                      (back_red, back_green, back_blue),
1231
 
+                      f_rgb, b_rgb,
1232
 
                       x, y):
1233
 
+        fore_red, fore_green, fore_blue = f_rgb
1234
 
+        back_red, back_green, back_blue = b_rgb
1235
 
         cid = self.display.allocate_resource_id()
1236
 
         request.CreateCursor(display = self.display,
1237
 
                              cid = cid,
1238
 
Index: python-xlib-0.14+20091101/Xlib/xobject/fontable.py
1239
 
===================================================================
1240
 
--- python-xlib-0.14+20091101.orig/Xlib/xobject/fontable.py     2013-10-11 14:19:21.117971349 -0400
1241
 
+++ python-xlib-0.14+20091101/Xlib/xobject/fontable.py  2013-10-11 14:19:21.089971348 -0400
1242
 
@@ -17,9 +17,7 @@
1243
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1244
 
 
1245
 
 from Xlib.protocol import request
1246
 
-
1247
 
-import resource
1248
 
-import cursor
1249
 
+from Xlib.xobject import resource, cursor
1250
 
 
1251
 
 class Fontable(resource.Resource):
1252
 
     __fontable__ = resource.Resource.__resource__
1253
 
@@ -85,8 +83,9 @@
1254
 
         self.display.free_resource_id(self.id)
1255
 
 
1256
 
     def create_glyph_cursor(self, mask, source_char, mask_char,
1257
 
-                            (fore_red, fore_green, fore_blue),
1258
 
-                            (back_red, back_green, back_blue)):
1259
 
+                            f_rgb, b_rgb):
1260
 
+        fore_red, fore_green, fore_blue = f_rgb
1261
 
+        back_red, back_green, back_blue = b_rgb
1262
 
 
1263
 
         cid = self.display.allocate_resource_id()
1264
 
         request.CreateGlyphCursor(display = self.display,
1265
 
Index: python-xlib-0.14+20091101/examples/childwin.py
1266
 
===================================================================
1267
 
--- python-xlib-0.14+20091101.orig/examples/childwin.py 2013-10-11 14:19:21.117971349 -0400
1268
 
+++ python-xlib-0.14+20091101/examples/childwin.py      2013-10-11 14:19:21.093971349 -0400
1269
 
@@ -54,10 +54,10 @@
1270
 
 
1271
 
                bggc.change(foreground=self.screen.white_pixel)
1272
 
 
1273
 
-               bgpm.arc(bggc, -bgsize / 2, 0, bgsize, bgsize, 0, 360 * 64)
1274
 
-               bgpm.arc(bggc, bgsize / 2, 0, bgsize, bgsize, 0, 360 * 64)
1275
 
-               bgpm.arc(bggc, 0, -bgsize / 2, bgsize, bgsize, 0, 360 * 64)
1276
 
-               bgpm.arc(bggc, 0, bgsize / 2, bgsize, bgsize, 0, 360 * 64)
1277
 
+               bgpm.arc(bggc, -bgsize // 2, 0, bgsize, bgsize, 0, 360 * 64)
1278
 
+               bgpm.arc(bggc, bgsize // 2, 0, bgsize, bgsize, 0, 360 * 64)
1279
 
+               bgpm.arc(bggc, 0, -bgsize // 2, bgsize, bgsize, 0, 360 * 64)
1280
 
+               bgpm.arc(bggc, 0, bgsize // 2, bgsize, bgsize, 0, 360 * 64)
1281
 
 
1282
 
                # Actual window
1283
 
                self.window = self.screen.root.create_window(
1284
 
@@ -127,10 +127,10 @@
1285
 
                        # Button released, add or subtract
1286
 
                        elif e.type == X.ButtonRelease:
1287
 
                                if e.detail == 1:
1288
 
-                                       print "Moving child window."
1289
 
+                                       print("Moving child window.")
1290
 
                                        self.childWindow.configure(
1291
 
-                                               x=e.event_x - self.childWidth / 2,
1292
 
-                                               y=e.event_y - self.childHeight / 2
1293
 
+                                               x=e.event_x - self.childWidth // 2,
1294
 
+                                               y=e.event_y - self.childHeight // 2
1295
 
                                                )
1296
 
                                        self.d.flush()
1297
 
 
1298
 
Index: python-xlib-0.14+20091101/examples/profilex.py
1299
 
===================================================================
1300
 
--- python-xlib-0.14+20091101.orig/examples/profilex.py 2013-10-11 14:19:21.117971349 -0400
1301
 
+++ python-xlib-0.14+20091101/examples/profilex.py      2013-10-11 14:19:21.093971349 -0400
1302
 
@@ -18,9 +18,9 @@
1303
 
     r = d.screen().root
1304
 
     cm = d.screen().default_colormap
1305
 
 
1306
 
-    for i in xrange(0, 1000):
1307
 
+    for i in range(0, 1000):
1308
 
         if i % 50 == 0:
1309
 
-            print 'Iteration', i
1310
 
+            print('Iteration %i' % i)
1311
 
 
1312
 
         r.delete_property(Xatom.WM_NORMAL_HINTS)
1313
 
         r.delete_property(Xatom.WM_NORMAL_HINTS)
1314
 
@@ -39,4 +39,4 @@
1315
 
     if len(sys.argv) == 2:
1316
 
         main(sys.argv[1])
1317
 
     else:
1318
 
-        print sys.argv[0], "<filename to write profile output to>"
1319
 
+        print(sys.argv[0] + " <filename to write profile output to>")
1320
 
Index: python-xlib-0.14+20091101/examples/record_demo.py
1321
 
===================================================================
1322
 
--- python-xlib-0.14+20091101.orig/examples/record_demo.py      2013-10-11 14:19:21.117971349 -0400
1323
 
+++ python-xlib-0.14+20091101/examples/record_demo.py   2013-10-11 14:19:21.093971349 -0400
1324
 
@@ -44,9 +44,9 @@
1325
 
     if reply.category != record.FromServer:
1326
 
         return
1327
 
     if reply.client_swapped:
1328
 
-        print "* received swapped protocol data, cowardly ignored"
1329
 
+        print("* received swapped protocol data, cowardly ignored")
1330
 
         return
1331
 
-    if not len(reply.data) or ord(reply.data[0]) < 2:
1332
 
+    if not len(reply.data) or reply.data[0] < 2:
1333
 
         # not an event
1334
 
         return
1335
 
 
1336
 
@@ -59,28 +59,28 @@
1337
 
 
1338
 
             keysym = local_dpy.keycode_to_keysym(event.detail, 0)
1339
 
             if not keysym:
1340
 
-                print "KeyCode%s" % pr, event.detail
1341
 
+                print("KeyCode%s %s" % (pr, event.detail))
1342
 
             else:
1343
 
-                print "KeyStr%s" % pr, lookup_keysym(keysym)
1344
 
+                print("KeyStr%s %s" % (pr, lookup_keysym(keysym)))
1345
 
 
1346
 
             if event.type == X.KeyPress and keysym == XK.XK_Escape:
1347
 
                 local_dpy.record_disable_context(ctx)
1348
 
                 local_dpy.flush()
1349
 
                 return
1350
 
         elif event.type == X.ButtonPress:
1351
 
-            print "ButtonPress", event.detail
1352
 
+            print("ButtonPress %s" % event.detail)
1353
 
         elif event.type == X.ButtonRelease:
1354
 
-            print "ButtonRelease", event.detail
1355
 
+            print("ButtonRelease %s" % event.detail)
1356
 
         elif event.type == X.MotionNotify:
1357
 
-            print "MotionNotify", event.root_x, event.root_y
1358
 
+            print("MotionNotify %i %i" % (event.root_x, event.root_y))
1359
 
 
1360
 
 
1361
 
 # Check if the extension is present
1362
 
 if not record_dpy.has_extension("RECORD"):
1363
 
-    print "RECORD extension not found"
1364
 
+    print("RECORD extension not found")
1365
 
     sys.exit(1)
1366
 
 r = record_dpy.record_get_version(0, 0)
1367
 
-print "RECORD extension version %d.%d" % (r.major_version, r.minor_version)
1368
 
+print("RECORD extension version %d.%d" % (r.major_version, r.minor_version))
1369
 
 
1370
 
 # Create a recording context; we only want key and mouse events
1371
 
 ctx = record_dpy.record_create_context(
1372
 
Index: python-xlib-0.14+20091101/examples/shapewin.py
1373
 
===================================================================
1374
 
--- python-xlib-0.14+20091101.orig/examples/shapewin.py 2013-10-11 14:19:21.117971349 -0400
1375
 
+++ python-xlib-0.14+20091101/examples/shapewin.py      2013-10-11 14:19:21.093971349 -0400
1376
 
@@ -41,7 +41,7 @@
1377
 
 
1378
 
         # print version
1379
 
         r = self.d.shape_query_version()
1380
 
-        print 'SHAPE version %d.%d' % (r.major_version, r.minor_version)
1381
 
+        print('SHAPE version %d.%d' % (r.major_version, r.minor_version))
1382
 
 
1383
 
 
1384
 
         # Find which screen to open the window on
1385
 
@@ -59,10 +59,10 @@
1386
 
 
1387
 
         bggc.change(foreground = self.screen.white_pixel)
1388
 
 
1389
 
-        bgpm.arc(bggc, -bgsize / 2, 0, bgsize, bgsize, 0, 360 * 64)
1390
 
-        bgpm.arc(bggc, bgsize / 2, 0, bgsize, bgsize, 0, 360 * 64)
1391
 
-        bgpm.arc(bggc, 0, -bgsize / 2, bgsize, bgsize, 0, 360 * 64)
1392
 
-        bgpm.arc(bggc, 0, bgsize / 2, bgsize, bgsize, 0, 360 * 64)
1393
 
+        bgpm.arc(bggc, -bgsize // 2, 0, bgsize, bgsize, 0, 360 * 64)
1394
 
+        bgpm.arc(bggc, bgsize // 2, 0, bgsize, bgsize, 0, 360 * 64)
1395
 
+        bgpm.arc(bggc, 0, -bgsize // 2, bgsize, bgsize, 0, 360 * 64)
1396
 
+        bgpm.arc(bggc, 0, bgsize // 2, bgsize, bgsize, 0, 360 * 64)
1397
 
 
1398
 
         # Actual window
1399
 
         self.window = self.screen.root.create_window(
1400
 
@@ -112,10 +112,10 @@
1401
 
         self.sub_pm.fill_rectangle(gc, 0, 0, self.sub_size, self.sub_size)
1402
 
         gc.change(foreground = 1)
1403
 
         self.sub_pm.fill_poly(gc, X.Convex, X.CoordModeOrigin,
1404
 
-                              [(self.sub_size / 2, 0),
1405
 
-                               (self.sub_size, self.sub_size / 2),
1406
 
-                               (self.sub_size / 2, self.sub_size),
1407
 
-                               (0, self.sub_size / 2)])
1408
 
+                              [(self.sub_size // 2, 0),
1409
 
+                               (self.sub_size, self.sub_size // 2),
1410
 
+                               (self.sub_size // 2, self.sub_size),
1411
 
+                               (0, self.sub_size // 2)])
1412
 
         gc.free()
1413
 
 
1414
 
         # Set initial mask
1415
 
@@ -151,19 +151,19 @@
1416
 
                 if e.detail == 1:
1417
 
                     self.window.shape_mask(shape.ShapeUnion,
1418
 
                                            shape.ShapeBounding,
1419
 
-                                           e.event_x - self.add_size / 2,
1420
 
-                                           e.event_y - self.add_size / 2,
1421
 
+                                           e.event_x - self.add_size // 2,
1422
 
+                                           e.event_y - self.add_size // 2,
1423
 
                                            self.add_pm)
1424
 
                 elif e.detail == 3:
1425
 
                     self.window.shape_mask(shape.ShapeSubtract,
1426
 
                                            shape.ShapeBounding,
1427
 
-                                           e.event_x - self.sub_size / 2,
1428
 
-                                           e.event_y - self.sub_size / 2,
1429
 
+                                           e.event_x - self.sub_size // 2,
1430
 
+                                           e.event_y - self.sub_size // 2,
1431
 
                                            self.sub_pm)
1432
 
 
1433
 
             # Shape has changed
1434
 
             elif e.type == self.d.extension_event.ShapeNotify:
1435
 
-                print 'Shape change'
1436
 
+                print('Shape change')
1437
 
 
1438
 
             # Somebody wants to tell us something
1439
 
             elif e.type == X.ClientMessage:
1440
 
Index: python-xlib-0.14+20091101/examples/threadtest.py
1441
 
===================================================================
1442
 
--- python-xlib-0.14+20091101.orig/examples/threadtest.py       2013-10-11 14:19:21.117971349 -0400
1443
 
+++ python-xlib-0.14+20091101/examples/threadtest.py    2013-10-11 14:19:21.093971349 -0400
1444
 
@@ -7,7 +7,13 @@
1445
 
 
1446
 
 from Xlib import display, X, threaded
1447
 
 import time
1448
 
-import thread
1449
 
+
1450
 
+try:
1451
 
+    # Python 3
1452
 
+    import _thread as thread
1453
 
+except ImportError:
1454
 
+    # Python 2
1455
 
+    import thread
1456
 
 
1457
 
 def redraw(win, gc):
1458
 
     # win.clear_area()
1459
 
@@ -16,7 +22,7 @@
1460
 
 def blink(display, win, gc, cols):
1461
 
     while 1:
1462
 
         time.sleep(2)
1463
 
-        print 'Changing color', cols[0]
1464
 
+        print('Changing color %i' % cols[0])
1465
 
         gc.change(foreground = cols[0])
1466
 
         cols = (cols[1], cols[0])
1467
 
         redraw(win, gc)
1468
 
Index: python-xlib-0.14+20091101/examples/xinerama.py
1469
 
===================================================================
1470
 
--- python-xlib-0.14+20091101.orig/examples/xinerama.py 2013-10-11 14:19:21.117971349 -0400
1471
 
+++ python-xlib-0.14+20091101/examples/xinerama.py      2013-10-11 14:19:21.093971349 -0400
1472
 
@@ -36,14 +36,14 @@
1473
 
         if not self.d.has_extension('XINERAMA'):
1474
 
             sys.stderr.write('%s: server does not have the XINERAMA extension\n'
1475
 
                              % sys.argv[0])
1476
 
-            print self.d.query_extension('XINERAMA')
1477
 
+            print(self.d.query_extension('XINERAMA'))
1478
 
             sys.stderr.write("\n".join(self.d.list_extensions()))
1479
 
             if self.d.query_extension('XINERAMA') is None:
1480
 
                 sys.exit(1)
1481
 
 
1482
 
         # print version
1483
 
         r = self.d.xinerama_query_version()
1484
 
-        print 'XINERAMA version %d.%d' % (r.major_version, r.minor_version)
1485
 
+        print('XINERAMA version %d.%d' % (r.major_version, r.minor_version))
1486
 
 
1487
 
 
1488
 
         # Grab the current screen
1489
 
@@ -93,23 +93,23 @@
1490
 
 
1491
 
         self.pp = pprint.PrettyPrinter(indent=4)
1492
 
 
1493
 
-        print "Xinerama active:", bool(self.d.xinerama_is_active())
1494
 
+        print("Xinerama active:" + str(bool(self.d.xinerama_is_active())))
1495
 
 
1496
 
-        print "Screen info:"
1497
 
+        print("Screen info:")
1498
 
         self.pp.pprint(self.d.xinerama_query_screens()._data)
1499
 
 
1500
 
         # FIXME: This doesn't work!
1501
 
         #print "Xinerama info:"
1502
 
         #self.pp.pprint(self.d.xinerama_get_info(self.d.screen().root_visual)._data)
1503
 
 
1504
 
-        print "Xinerama state:"
1505
 
+        print("Xinerama state:")
1506
 
         self.pp.pprint(self.window.xinerama_get_state()._data)
1507
 
 
1508
 
-        print "Screen count:"
1509
 
+        print("Screen count:")
1510
 
         self.pp.pprint(self.window.xinerama_get_screen_count()._data)
1511
 
 
1512
 
         for screennum in range(self.window.xinerama_get_screen_count().screen_count):
1513
 
-            print "Screen %d size:" % (screennum, )
1514
 
+            print("Screen %d size:" % (screennum, ))
1515
 
             self.pp.pprint(self.window.xinerama_get_screen_size(screennum)._data)
1516
 
 
1517
 
     def parseModes(self, mode_names, modes):
1518
 
Index: python-xlib-0.14+20091101/examples/xrandr.py
1519
 
===================================================================
1520
 
--- python-xlib-0.14+20091101.orig/examples/xrandr.py   2013-10-11 14:19:21.117971349 -0400
1521
 
+++ python-xlib-0.14+20091101/examples/xrandr.py        2013-10-11 14:19:21.093971349 -0400
1522
 
@@ -36,14 +36,14 @@
1523
 
         if not self.d.has_extension('RANDR'):
1524
 
             sys.stderr.write('%s: server does not have the RANDR extension\n'
1525
 
                              % sys.argv[0])
1526
 
-            print self.d.query_extension('RANDR')
1527
 
+            print(self.d.query_extension('RANDR'))
1528
 
             sys.stderr.write("\n".join(self.d.list_extensions()))
1529
 
             if self.d.query_extension('RANDR') is None:
1530
 
                 sys.exit(1)
1531
 
 
1532
 
         # print version
1533
 
         r = self.d.xrandr_query_version()
1534
 
-        print 'RANDR version %d.%d' % (r.major_version, r.minor_version)
1535
 
+        print('RANDR version %d.%d' % (r.major_version, r.minor_version))
1536
 
 
1537
 
 
1538
 
         # Grab the current screen
1539
 
@@ -101,30 +101,30 @@
1540
 
 
1541
 
         self.pp = pprint.PrettyPrinter(indent=4)
1542
 
 
1543
 
-        print "Screen info:"
1544
 
+        print("Screen info:")
1545
 
         self.pp.pprint(self.window.xrandr_get_screen_info()._data)
1546
 
 
1547
 
-        print "Screen size range:"
1548
 
+        print("Screen size range:")
1549
 
         self.pp.pprint(self.window.xrandr_get_screen_size_range()._data)
1550
 
 
1551
 
-        print "Primary output:"
1552
 
+        print("Primary output:")
1553
 
         self.pp.pprint(self.window.xrandr_get_output_primary()._data)
1554
 
 
1555
 
         resources = self.window.xrandr_get_screen_resources()._data
1556
 
 
1557
 
-        print "Modes:"
1558
 
-        for mode_id, mode in self.parseModes(resources['mode_names'], resources['modes']).iteritems():
1559
 
-            print "    %d: %s" % (mode_id, mode['name'])
1560
 
+        print("Modes:")
1561
 
+        for mode_id, mode in self.parseModes(resources['mode_names'], resources['modes']).items():
1562
 
+            print("    %d: %s" % (mode_id, mode['name']))
1563
 
 
1564
 
         for output in resources['outputs']:
1565
 
-            print "Output %d info:" % (output, )
1566
 
+            print("Output %d info:" % (output, ))
1567
 
             self.pp.pprint(self.d.xrandr_get_output_info(output, resources['config_timestamp'])._data)
1568
 
 
1569
 
         for crtc in resources['crtcs']:
1570
 
-            print "CRTC %d info:" % (crtc, )
1571
 
+            print("CRTC %d info:" % (crtc, ))
1572
 
             self.pp.pprint(self.d.xrandr_get_crtc_info(crtc, resources['config_timestamp'])._data)
1573
 
 
1574
 
-        print "Raw screen resources:"
1575
 
+        print("Raw screen resources:")
1576
 
         self.pp.pprint(resources)
1577
 
 
1578
 
     def parseModes(self, mode_names, modes):
1579
 
@@ -149,23 +149,23 @@
1580
 
 
1581
 
             # Screen information has changed
1582
 
             elif e.type == self.d.extension_event.ScreenChangeNotify:
1583
 
-                print 'Screen change'
1584
 
-                print self.pp.pprint(e._data)
1585
 
+                print('Screen change')
1586
 
+                print(self.pp.pprint(e._data))
1587
 
 
1588
 
             # CRTC information has changed
1589
 
             elif e.type == self.d.extension_event.CrtcChangeNotify:
1590
 
-                print 'CRTC change'
1591
 
-                print self.pp.pprint(e._data)
1592
 
+                print('CRTC change')
1593
 
+                print(self.pp.pprint(e._data))
1594
 
 
1595
 
             # Output information has changed
1596
 
             elif e.type == self.d.extension_event.OutputChangeNotify:
1597
 
-                print 'Output change'
1598
 
-                print self.pp.pprint(e._data)
1599
 
+                print('Output change')
1600
 
+                print(self.pp.pprint(e._data))
1601
 
 
1602
 
             # Output property information has changed
1603
 
             elif e.type == self.d.extension_event.OutputPropertyNotify:
1604
 
-                print 'Output property change'
1605
 
-                print self.pp.pprint(e._data)
1606
 
+                print('Output property change')
1607
 
+                print(self.pp.pprint(e._data))
1608
 
 
1609
 
             # Somebody wants to tell us something
1610
 
             elif e.type == X.ClientMessage:
1611
 
Index: python-xlib-0.14+20091101/Xlib/display.py
1612
 
===================================================================
1613
 
--- python-xlib-0.14+20091101.orig/Xlib/display.py      2013-10-11 14:19:21.117971349 -0400
1614
 
+++ python-xlib-0.14+20091101/Xlib/display.py   2013-10-11 14:19:21.093971349 -0400
1615
 
@@ -17,34 +17,31 @@
1616
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1617
 
 
1618
 
 # Python modules
1619
 
-import new
1620
 
+import types
1621
 
 
1622
 
 # Xlib modules
1623
 
-import error
1624
 
-import ext
1625
 
-import X
1626
 
+from Xlib import error, ext, X
1627
 
 
1628
 
 # Xlib.protocol modules
1629
 
-import protocol.display
1630
 
-from protocol import request, event, rq
1631
 
+from Xlib.protocol import display, request, event, rq
1632
 
 
1633
 
 # Xlib.xobjects modules
1634
 
-import xobject.resource
1635
 
-import xobject.drawable
1636
 
-import xobject.fontable
1637
 
-import xobject.colormap
1638
 
-import xobject.cursor
1639
 
+import Xlib.xobject.resource
1640
 
+import Xlib.xobject.drawable
1641
 
+import Xlib.xobject.fontable
1642
 
+import Xlib.xobject.colormap
1643
 
+import Xlib.xobject.cursor
1644
 
 
1645
 
 _resource_baseclasses = {
1646
 
-    'resource': xobject.resource.Resource,
1647
 
-    'drawable': xobject.drawable.Drawable,
1648
 
-    'window': xobject.drawable.Window,
1649
 
-    'pixmap': xobject.drawable.Pixmap,
1650
 
-    'fontable': xobject.fontable.Fontable,
1651
 
-    'font': xobject.fontable.Font,
1652
 
-    'gc': xobject.fontable.GC,
1653
 
-    'colormap': xobject.colormap.Colormap,
1654
 
-    'cursor': xobject.cursor.Cursor,
1655
 
+    'resource': Xlib.xobject.resource.Resource,
1656
 
+    'drawable': Xlib.xobject.drawable.Drawable,
1657
 
+    'window': Xlib.xobject.drawable.Window,
1658
 
+    'pixmap': Xlib.xobject.drawable.Pixmap,
1659
 
+    'fontable': Xlib.xobject.fontable.Fontable,
1660
 
+    'font': Xlib.xobject.fontable.Font,
1661
 
+    'gc': Xlib.xobject.fontable.GC,
1662
 
+    'colormap': Xlib.xobject.colormap.Colormap,
1663
 
+    'cursor': Xlib.xobject.cursor.Cursor,
1664
 
     }
1665
 
 
1666
 
 _resource_hierarchy = {
1667
 
@@ -55,18 +52,18 @@
1668
 
     'fontable': ('font', 'gc')
1669
 
     }
1670
 
 
1671
 
-class _BaseDisplay(protocol.display.Display):
1672
 
+class _BaseDisplay(display.Display):
1673
 
     resource_classes = _resource_baseclasses.copy()
1674
 
 
1675
 
     # Implement a cache of atom names, used by Window objects when
1676
 
     # dealing with some ICCCM properties not defined in Xlib.Xatom
1677
 
 
1678
 
     def __init__(self, *args, **keys):
1679
 
-        apply(protocol.display.Display.__init__, (self, ) + args, keys)
1680
 
+        display.Display.__init__(*(self, ) + args, **keys)
1681
 
         self._atom_cache = {}
1682
 
 
1683
 
     def get_atom(self, atomname, only_if_exists=0):
1684
 
-        if self._atom_cache.has_key(atomname):
1685
 
+        if atomname in self._atom_cache:
1686
 
             return self._atom_cache[atomname]
1687
 
 
1688
 
         r = request.InternAtom(display = self, name = atomname, only_if_exists = only_if_exists)
1689
 
@@ -119,11 +116,11 @@
1690
 
 
1691
 
 
1692
 
         # Finalize extensions by creating new classes
1693
 
-        for type, dict in self.class_extension_dicts.items():
1694
 
-            origcls = self.display.resource_classes[type]
1695
 
-            self.display.resource_classes[type] = new.classobj(origcls.__name__,
1696
 
-                                                               (origcls,),
1697
 
-                                                               dict)
1698
 
+        for type_, dict in self.class_extension_dicts.items():
1699
 
+            origcls = self.display.resource_classes[type_]
1700
 
+            self.display.resource_classes[type_] = type(origcls.__name__,
1701
 
+                                                        (origcls, object),
1702
 
+                                                        dict)
1703
 
 
1704
 
         # Problem: we have already created some objects without the
1705
 
         # extensions: the screen roots and default colormaps.
1706
 
@@ -211,7 +208,7 @@
1707
 
     def __getattr__(self, attr):
1708
 
         try:
1709
 
             function = self.display_extension_methods[attr]
1710
 
-            return new.instancemethod(function, self, self.__class__)
1711
 
+            return types.MethodType(function, self)
1712
 
         except KeyError:
1713
 
             raise AttributeError(attr)
1714
 
 
1715
 
@@ -272,13 +269,11 @@
1716
 
                 if hasattr(cls, name):
1717
 
                     raise error.MethodOverrideError('attempting to replace %s method: %s' % (type, name))
1718
 
 
1719
 
-                method = new.instancemethod(function, None, cls)
1720
 
-
1721
 
                 # Maybe should check extension overrides too
1722
 
                 try:
1723
 
-                    self.class_extension_dicts[type][name] = method
1724
 
+                    self.class_extension_dicts[type][name] = function
1725
 
                 except KeyError:
1726
 
-                    self.class_extension_dicts[type] = { name: method }
1727
 
+                    self.class_extension_dicts[type] = { name: function }
1728
 
 
1729
 
     def extension_add_event(self, code, evt, name = None):
1730
 
         """extension_add_event(code, evt, [name])
1731
 
@@ -292,8 +287,8 @@
1732
 
         extension_event.
1733
 
         """
1734
 
 
1735
 
-        newevt = new.classobj(evt.__name__, evt.__bases__,
1736
 
-                              evt.__dict__.copy())
1737
 
+        newevt = type(evt.__name__, evt.__bases__,
1738
 
+                      evt.__dict__.copy())
1739
 
         newevt._code = code
1740
 
 
1741
 
         self.display.add_extension_event(code, newevt)
1742
 
@@ -395,7 +390,7 @@
1743
 
             index = 0
1744
 
             for sym in syms:
1745
 
                 if sym != X.NoSymbol:
1746
 
-                    if self._keymap_syms.has_key(sym):
1747
 
+                    if sym in self._keymap_syms:
1748
 
                         symcodes = self._keymap_syms[sym]
1749
 
                         symcodes.append((index, code))
1750
 
                         symcodes.sort()
1751
 
@@ -595,7 +590,7 @@
1752
 
             self.display.free_resource_id(fid)
1753
 
             return None
1754
 
         else:
1755
 
-            cls = self.display.get_resource_class('font', xobject.fontable.Font)
1756
 
+            cls = self.display.get_resource_class('font', Xlib.xobject.fontable.Font)
1757
 
             return cls(self.display, fid, owner = 1)
1758
 
 
1759
 
     def list_fonts(self, pattern, max_names):
1760
 
Index: python-xlib-0.14+20091101/Xlib/protocol/request.py
1761
 
===================================================================
1762
 
--- python-xlib-0.14+20091101.orig/Xlib/protocol/request.py     2013-10-11 14:19:21.117971349 -0400
1763
 
+++ python-xlib-0.14+20091101/Xlib/protocol/request.py  2013-10-11 14:19:21.097971349 -0400
1764
 
@@ -21,8 +21,7 @@
1765
 
 from Xlib import X
1766
 
 
1767
 
 # Xlib.protocol modules
1768
 
-import rq
1769
 
-import structs
1770
 
+from Xlib.protocol import rq, structs
1771
 
 
1772
 
 
1773
 
 class CreateWindow(rq.Request):
1774
 
@@ -784,7 +783,7 @@
1775
 
 
1776
 
     def __init__(self, *args, **keys):
1777
 
         self._fonts = []
1778
 
-        apply(ReplyRequest.__init__, (self, ) + args, keys)
1779
 
+        ReplyRequest.__init__(*(self, ) + args, **keys)
1780
 
 
1781
 
     def _parse_response(self, data):
1782
 
 
1783
 
Index: python-xlib-0.14+20091101/Xlib/protocol/structs.py
1784
 
===================================================================
1785
 
--- python-xlib-0.14+20091101.orig/Xlib/protocol/structs.py     2013-10-11 14:19:21.117971349 -0400
1786
 
+++ python-xlib-0.14+20091101/Xlib/protocol/structs.py  2013-10-11 14:19:21.097971349 -0400
1787
 
@@ -20,7 +20,7 @@
1788
 
 from Xlib import X
1789
 
 
1790
 
 # Xlib.protocol modules
1791
 
-import rq
1792
 
+from Xlib.protocol import rq
1793
 
 
1794
 
 def WindowValues(arg):
1795
 
     return rq.ValueList( arg, 4, 0,
1796
 
Index: python-xlib-0.14+20091101/Xlib/support/connect.py
1797
 
===================================================================
1798
 
--- python-xlib-0.14+20091101.orig/Xlib/support/connect.py      2013-10-11 14:19:21.117971349 -0400
1799
 
+++ python-xlib-0.14+20091101/Xlib/support/connect.py   2013-10-11 14:19:21.097971349 -0400
1800
 
@@ -17,7 +17,6 @@
1801
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
1802
 
 
1803
 
 import sys
1804
 
-import string
1805
 
 
1806
 
 # List the modules which contain the corresponding functions
1807
 
 
1808
 
@@ -43,7 +42,7 @@
1809
 
 # Figure out which OS we're using.
1810
 
 # sys.platform is either "OS-ARCH" or just "OS".
1811
 
 
1812
 
-_parts = string.split(sys.platform, '-')
1813
 
+_parts = sys.platform.split('-')
1814
 
 platform = _parts[0]
1815
 
 del _parts
1816
 
 
1817
 
@@ -61,8 +60,8 @@
1818
 
     """
1819
 
 
1820
 
     modname = _display_mods.get(platform, _default_display_mod)
1821
 
-    mod = __import__(modname, globals())
1822
 
-    return mod.get_display(display)
1823
 
+    mod = __import__('Xlib.support', globals(), fromlist=(modname,))
1824
 
+    return getattr(mod, modname).get_display(display)
1825
 
 
1826
 
 
1827
 
 def get_socket(dname, host, dno):
1828
 
@@ -75,8 +74,8 @@
1829
 
     """
1830
 
 
1831
 
     modname = _socket_mods.get(platform, _default_socket_mod)
1832
 
-    mod = __import__(modname, globals())
1833
 
-    return mod.get_socket(dname, host, dno)
1834
 
+    mod = __import__('Xlib.support', globals(), fromlist=(modname,))
1835
 
+    return getattr(mod, modname).get_socket(dname, host, dno)
1836
 
 
1837
 
 
1838
 
 def get_auth(sock, dname, host, dno):
1839
 
@@ -90,5 +89,5 @@
1840
 
     """
1841
 
 
1842
 
     modname = _auth_mods.get(platform, _default_auth_mod)
1843
 
-    mod = __import__(modname, globals())
1844
 
-    return mod.get_auth(sock, dname, host, dno)
1845
 
+    mod = __import__('Xlib.support', globals(), fromlist=(modname,))
1846
 
+    return getattr(mod, modname).get_auth(sock, dname, host, dno)
1847
 
Index: python-xlib-0.14+20091101/test/test_events_be.py
1848
 
===================================================================
1849
 
--- python-xlib-0.14+20091101.orig/test/test_events_be.py       2013-10-11 14:19:21.117971349 -0400
1850
 
+++ python-xlib-0.14+20091101/test/test_events_be.py    2013-10-11 14:19:21.097971349 -0400
1851
 
@@ -3,7 +3,6 @@
1852
 
 import sys, os
1853
 
 sys.path.insert(1, os.path.join(sys.path[0], '..'))
1854
 
 
1855
 
-import string
1856
 
 import unittest
1857
 
 from Xlib.protocol import request, rq, event
1858
 
 import Xlib.protocol.event
1859
 
@@ -13,7 +12,7 @@
1860
 
 
1861
 
 class CmpArray:
1862
 
     def __init__(self, *args, **kws):
1863
 
-        self.array = apply(array.array, args, kws)
1864
 
+        self.array = array.array(*args, **kws)
1865
 
 
1866
 
     def __len__(self):
1867
 
         return len(self.array)
1868
 
@@ -24,13 +23,16 @@
1869
 
     def __getattr__(self, attr):
1870
 
         return getattr(self.array, attr)
1871
 
 
1872
 
-    def __cmp__(self, other):
1873
 
-        return cmp(self.array.tolist(), other)
1874
 
+    def __eq__(self, other):
1875
 
+        return self.array.tolist() == other
1876
 
+
1877
 
+    def __ne__(self, other):
1878
 
+        return self.array.tolist() != other
1879
 
 
1880
 
 rq.array = CmpArray
1881
 
 
1882
 
 def tohex(bin):
1883
 
-    bin = string.join(map(lambda c: '\\x%02x' % ord(c), bin), '')
1884
 
+    bin = ''.join(map(lambda c: '\\x%02x' % c, bin))
1885
 
 
1886
 
     bins = []
1887
 
     for i in range(0, len(bin), 16):
1888
 
@@ -43,7 +45,7 @@
1889
 
         except IndexError:
1890
 
             bins2.append("'%s'" % bins[i])
1891
 
 
1892
 
-    return string.join(bins2, ' \\\n            ')
1893
 
+    return ' \\\n            '.join(bins2)
1894
 
 
1895
 
 class DummyDisplay:
1896
 
     def get_resource_class(self, x):
1897
 
@@ -66,14 +68,14 @@
1898
 
             'type': 154,
1899
 
             'data': [160, 192, 133, 223, 245, 128, 133, 188, 208, 142, 202, 142, 218, 238, 145, 150, 211, 150, 165, 230, 149, 162, 139, 159, 135, 255, 246, 202, 232, 185, 164],
1900
 
             }
1901
 
-        self.evt_bin_0 = '\x9a\xa0\xc0\x85' '\xdf\xf5\x80\x85' \
1902
 
-            '\xbc\xd0\x8e\xca' '\x8e\xda\xee\x91' \
1903
 
-            '\x96\xd3\x96\xa5' '\xe6\x95\xa2\x8b' \
1904
 
-            '\x9f\x87\xff\xf6' '\xca\xe8\xb9\xa4'
1905
 
+        self.evt_bin_0 = b'\x9a\xa0\xc0\x85' b'\xdf\xf5\x80\x85' \
1906
 
+            b'\xbc\xd0\x8e\xca' b'\x8e\xda\xee\x91' \
1907
 
+            b'\x96\xd3\x96\xa5' b'\xe6\x95\xa2\x8b' \
1908
 
+            b'\x9f\x87\xff\xf6' b'\xca\xe8\xb9\xa4'
1909
 
 
1910
 
 
1911
 
     def testPack0(self):
1912
 
-        bin = apply(event.KeymapNotify._fields.to_binary, (), self.evt_args_0)
1913
 
+        bin = event.KeymapNotify._fields.to_binary(*(), **self.evt_args_0)
1914
 
         try:
1915
 
             assert bin == self.evt_bin_0
1916
 
         except AssertionError:
1917
 
@@ -103,14 +105,14 @@
1918
 
             'width': 26369,
1919
 
             'count': 60118,
1920
 
             }
1921
 
-        self.evt_bin_0 = '\xfe\x00\xdb\xcc' '\x52\x5b\x35\x64' \
1922
 
-            '\x42\x4e\x4d\x28' '\x67\x01\x56\xc6' \
1923
 
-            '\xea\xd6\x00\x00' '\x00\x00\x00\x00' \
1924
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
1925
 
+        self.evt_bin_0 = b'\xfe\x00\xdb\xcc' b'\x52\x5b\x35\x64' \
1926
 
+            b'\x42\x4e\x4d\x28' b'\x67\x01\x56\xc6' \
1927
 
+            b'\xea\xd6\x00\x00' b'\x00\x00\x00\x00' \
1928
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1929
 
 
1930
 
 
1931
 
     def testPack0(self):
1932
 
-        bin = apply(event.Expose._fields.to_binary, (), self.evt_args_0)
1933
 
+        bin = event.Expose._fields.to_binary(*(), **self.evt_args_0)
1934
 
         try:
1935
 
             assert bin == self.evt_bin_0
1936
 
         except AssertionError:
1937
 
@@ -142,14 +144,14 @@
1938
 
             'width': 58556,
1939
 
             'minor_event': 22632,
1940
 
             }
1941
 
-        self.evt_bin_0 = '\xf2\x00\x18\xec' '\x30\xe6\x7b\x80' \
1942
 
-            '\xe0\xf9\xa3\x22' '\xe4\xbc\x01\x60' \
1943
 
-            '\x58\x68\xf7\x59' '\xd8\x00\x00\x00' \
1944
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
1945
 
+        self.evt_bin_0 = b'\xf2\x00\x18\xec' b'\x30\xe6\x7b\x80' \
1946
 
+            b'\xe0\xf9\xa3\x22' b'\xe4\xbc\x01\x60' \
1947
 
+            b'\x58\x68\xf7\x59' b'\xd8\x00\x00\x00' \
1948
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1949
 
 
1950
 
 
1951
 
     def testPack0(self):
1952
 
-        bin = apply(event.GraphicsExpose._fields.to_binary, (), self.evt_args_0)
1953
 
+        bin = event.GraphicsExpose._fields.to_binary(*(), **self.evt_args_0)
1954
 
         try:
1955
 
             assert bin == self.evt_bin_0
1956
 
         except AssertionError:
1957
 
@@ -176,14 +178,14 @@
1958
 
             'window': 1319843810,
1959
 
             'minor_event': 45687,
1960
 
             }
1961
 
-        self.evt_bin_0 = '\xbb\x00\xb4\x5b' '\x4e\xab\x37\xe2' \
1962
 
-            '\xb2\x77\xf2\x00' '\x00\x00\x00\x00' \
1963
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1964
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
1965
 
+        self.evt_bin_0 = b'\xbb\x00\xb4\x5b' b'\x4e\xab\x37\xe2' \
1966
 
+            b'\xb2\x77\xf2\x00' b'\x00\x00\x00\x00' \
1967
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
1968
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1969
 
 
1970
 
 
1971
 
     def testPack0(self):
1972
 
-        bin = apply(event.NoExpose._fields.to_binary, (), self.evt_args_0)
1973
 
+        bin = event.NoExpose._fields.to_binary(*(), **self.evt_args_0)
1974
 
         try:
1975
 
             assert bin == self.evt_bin_0
1976
 
         except AssertionError:
1977
 
@@ -209,14 +211,14 @@
1978
 
             'type': 242,
1979
 
             'window': 1543431298,
1980
 
             }
1981
 
-        self.evt_bin_0 = '\xf2\x00\xce\x45' '\x5b\xfe\xe4\x82' \
1982
 
-            '\xee\x00\x00\x00' '\x00\x00\x00\x00' \
1983
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
1984
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
1985
 
+        self.evt_bin_0 = b'\xf2\x00\xce\x45' b'\x5b\xfe\xe4\x82' \
1986
 
+            b'\xee\x00\x00\x00' b'\x00\x00\x00\x00' \
1987
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
1988
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
1989
 
 
1990
 
 
1991
 
     def testPack0(self):
1992
 
-        bin = apply(event.VisibilityNotify._fields.to_binary, (), self.evt_args_0)
1993
 
+        bin = event.VisibilityNotify._fields.to_binary(*(), **self.evt_args_0)
1994
 
         try:
1995
 
             assert bin == self.evt_bin_0
1996
 
         except AssertionError:
1997
 
@@ -248,14 +250,14 @@
1998
 
             'window': 8505372,
1999
 
             'width': 8871,
2000
 
             }
2001
 
-        self.evt_bin_0 = '\xff\x00\x20\x3d' '\x27\x00\x3a\x54' \
2002
 
-            '\x00\x81\xc8\x1c' '\x86\x1c\xa2\x9c' \
2003
 
-            '\x22\xa7\x3c\x92' '\xd0\xa6\x01\x00' \
2004
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2005
 
+        self.evt_bin_0 = b'\xff\x00\x20\x3d' b'\x27\x00\x3a\x54' \
2006
 
+            b'\x00\x81\xc8\x1c' b'\x86\x1c\xa2\x9c' \
2007
 
+            b'\x22\xa7\x3c\x92' b'\xd0\xa6\x01\x00' \
2008
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2009
 
 
2010
 
 
2011
 
     def testPack0(self):
2012
 
-        bin = apply(event.CreateNotify._fields.to_binary, (), self.evt_args_0)
2013
 
+        bin = event.CreateNotify._fields.to_binary(*(), **self.evt_args_0)
2014
 
         try:
2015
 
             assert bin == self.evt_bin_0
2016
 
         except AssertionError:
2017
 
@@ -281,14 +283,14 @@
2018
 
             'type': 223,
2019
 
             'window': 1716558237,
2020
 
             }
2021
 
-        self.evt_bin_0 = '\xdf\x00\xbf\xf1' '\x18\x56\x02\x91' \
2022
 
-            '\x66\x50\x99\x9d' '\x00\x00\x00\x00' \
2023
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2024
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2025
 
+        self.evt_bin_0 = b'\xdf\x00\xbf\xf1' b'\x18\x56\x02\x91' \
2026
 
+            b'\x66\x50\x99\x9d' b'\x00\x00\x00\x00' \
2027
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2028
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2029
 
 
2030
 
 
2031
 
     def testPack0(self):
2032
 
-        bin = apply(event.DestroyNotify._fields.to_binary, (), self.evt_args_0)
2033
 
+        bin = event.DestroyNotify._fields.to_binary(*(), **self.evt_args_0)
2034
 
         try:
2035
 
             assert bin == self.evt_bin_0
2036
 
         except AssertionError:
2037
 
@@ -315,14 +317,14 @@
2038
 
             'type': 217,
2039
 
             'window': 1455493798,
2040
 
             }
2041
 
-        self.evt_bin_0 = '\xd9\x00\x11\x3c' '\x42\xe1\xef\x20' \
2042
 
-            '\x56\xc1\x12\xa6' '\x00\x00\x00\x00' \
2043
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2044
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2045
 
+        self.evt_bin_0 = b'\xd9\x00\x11\x3c' b'\x42\xe1\xef\x20' \
2046
 
+            b'\x56\xc1\x12\xa6' b'\x00\x00\x00\x00' \
2047
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2048
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2049
 
 
2050
 
 
2051
 
     def testPack0(self):
2052
 
-        bin = apply(event.UnmapNotify._fields.to_binary, (), self.evt_args_0)
2053
 
+        bin = event.UnmapNotify._fields.to_binary(*(), **self.evt_args_0)
2054
 
         try:
2055
 
             assert bin == self.evt_bin_0
2056
 
         except AssertionError:
2057
 
@@ -349,14 +351,14 @@
2058
 
             'window': 1882369959,
2059
 
             'override': 0,
2060
 
             }
2061
 
-        self.evt_bin_0 = '\xe4\x00\xfe\x48' '\x13\x96\x31\xdc' \
2062
 
-            '\x70\x32\xaf\xa7' '\x00\x00\x00\x00' \
2063
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2064
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2065
 
+        self.evt_bin_0 = b'\xe4\x00\xfe\x48' b'\x13\x96\x31\xdc' \
2066
 
+            b'\x70\x32\xaf\xa7' b'\x00\x00\x00\x00' \
2067
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2068
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2069
 
 
2070
 
 
2071
 
     def testPack0(self):
2072
 
-        bin = apply(event.MapNotify._fields.to_binary, (), self.evt_args_0)
2073
 
+        bin = event.MapNotify._fields.to_binary(*(), **self.evt_args_0)
2074
 
         try:
2075
 
             assert bin == self.evt_bin_0
2076
 
         except AssertionError:
2077
 
@@ -382,14 +384,14 @@
2078
 
             'type': 171,
2079
 
             'window': 488763730,
2080
 
             }
2081
 
-        self.evt_bin_0 = '\xab\x00\xc9\x60' '\x63\x32\x36\x90' \
2082
 
-            '\x1d\x21\xf1\x52' '\x00\x00\x00\x00' \
2083
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2084
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2085
 
+        self.evt_bin_0 = b'\xab\x00\xc9\x60' b'\x63\x32\x36\x90' \
2086
 
+            b'\x1d\x21\xf1\x52' b'\x00\x00\x00\x00' \
2087
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2088
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2089
 
 
2090
 
 
2091
 
     def testPack0(self):
2092
 
-        bin = apply(event.MapRequest._fields.to_binary, (), self.evt_args_0)
2093
 
+        bin = event.MapRequest._fields.to_binary(*(), **self.evt_args_0)
2094
 
         try:
2095
 
             assert bin == self.evt_bin_0
2096
 
         except AssertionError:
2097
 
@@ -419,14 +421,14 @@
2098
 
             'parent': 912114770,
2099
 
             'window': 1142506827,
2100
 
             }
2101
 
-        self.evt_bin_0 = '\xe5\x00\x24\x28' '\x77\x39\xbd\xd5' \
2102
 
-            '\x44\x19\x45\x4b' '\x36\x5d\xc4\x52' \
2103
 
-            '\x90\x55\xd2\xb3' '\x01\x00\x00\x00' \
2104
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2105
 
+        self.evt_bin_0 = b'\xe5\x00\x24\x28' b'\x77\x39\xbd\xd5' \
2106
 
+            b'\x44\x19\x45\x4b' b'\x36\x5d\xc4\x52' \
2107
 
+            b'\x90\x55\xd2\xb3' b'\x01\x00\x00\x00' \
2108
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2109
 
 
2110
 
 
2111
 
     def testPack0(self):
2112
 
-        bin = apply(event.ReparentNotify._fields.to_binary, (), self.evt_args_0)
2113
 
+        bin = event.ReparentNotify._fields.to_binary(*(), **self.evt_args_0)
2114
 
         try:
2115
 
             assert bin == self.evt_bin_0
2116
 
         except AssertionError:
2117
 
@@ -459,14 +461,14 @@
2118
 
             'window': 2046157981,
2119
 
             'width': 8604,
2120
 
             }
2121
 
-        self.evt_bin_0 = '\xbf\x00\xf3\x9c' '\x51\xdd\x44\x66' \
2122
 
-            '\x79\xf5\xe4\x9d' '\x41\x8b\x95\xa2' \
2123
 
-            '\xce\x1d\xc4\x84' '\x21\x9c\x3f\x73' \
2124
 
-            '\x1c\x4c\x01\x00' '\x00\x00\x00\x00'
2125
 
+        self.evt_bin_0 = b'\xbf\x00\xf3\x9c' b'\x51\xdd\x44\x66' \
2126
 
+            b'\x79\xf5\xe4\x9d' b'\x41\x8b\x95\xa2' \
2127
 
+            b'\xce\x1d\xc4\x84' b'\x21\x9c\x3f\x73' \
2128
 
+            b'\x1c\x4c\x01\x00' b'\x00\x00\x00\x00'
2129
 
 
2130
 
 
2131
 
     def testPack0(self):
2132
 
-        bin = apply(event.ConfigureNotify._fields.to_binary, (), self.evt_args_0)
2133
 
+        bin = event.ConfigureNotify._fields.to_binary(*(), **self.evt_args_0)
2134
 
         try:
2135
 
             assert bin == self.evt_bin_0
2136
 
         except AssertionError:
2137
 
@@ -500,14 +502,14 @@
2138
 
             'stack_mode': 199,
2139
 
             'parent': 176713389,
2140
 
             }
2141
 
-        self.evt_bin_0 = '\x9c\xc7\x7a\x91' '\x0a\x88\x6e\xad' \
2142
 
-            '\x49\x60\x48\x53' '\x44\xd3\x8b\x96' \
2143
 
-            '\xb8\xf1\xbb\x01' '\xc9\xa4\xb7\xf6' \
2144
 
-            '\xd5\xfb\x4b\x91' '\x00\x00\x00\x00'
2145
 
+        self.evt_bin_0 = b'\x9c\xc7\x7a\x91' b'\x0a\x88\x6e\xad' \
2146
 
+            b'\x49\x60\x48\x53' b'\x44\xd3\x8b\x96' \
2147
 
+            b'\xb8\xf1\xbb\x01' b'\xc9\xa4\xb7\xf6' \
2148
 
+            b'\xd5\xfb\x4b\x91' b'\x00\x00\x00\x00'
2149
 
 
2150
 
 
2151
 
     def testPack0(self):
2152
 
-        bin = apply(event.ConfigureRequest._fields.to_binary, (), self.evt_args_0)
2153
 
+        bin = event.ConfigureRequest._fields.to_binary(*(), **self.evt_args_0)
2154
 
         try:
2155
 
             assert bin == self.evt_bin_0
2156
 
         except AssertionError:
2157
 
@@ -535,14 +537,14 @@
2158
 
             'x': -21924,
2159
 
             'y': -4866,
2160
 
             }
2161
 
-        self.evt_bin_0 = '\xc0\x00\xa9\x70' '\x26\x3d\x12\xa5' \
2162
 
-            '\x03\x14\xd8\x1a' '\xaa\x5c\xec\xfe' \
2163
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2164
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2165
 
+        self.evt_bin_0 = b'\xc0\x00\xa9\x70' b'\x26\x3d\x12\xa5' \
2166
 
+            b'\x03\x14\xd8\x1a' b'\xaa\x5c\xec\xfe' \
2167
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2168
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2169
 
 
2170
 
 
2171
 
     def testPack0(self):
2172
 
-        bin = apply(event.GravityNotify._fields.to_binary, (), self.evt_args_0)
2173
 
+        bin = event.GravityNotify._fields.to_binary(*(), **self.evt_args_0)
2174
 
         try:
2175
 
             assert bin == self.evt_bin_0
2176
 
         except AssertionError:
2177
 
@@ -569,14 +571,14 @@
2178
 
             'window': 1698104652,
2179
 
             'width': 41494,
2180
 
             }
2181
 
-        self.evt_bin_0 = '\x95\x00\x53\x64' '\x65\x37\x05\x4c' \
2182
 
-            '\xa2\x16\xe9\x68' '\x00\x00\x00\x00' \
2183
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2184
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2185
 
+        self.evt_bin_0 = b'\x95\x00\x53\x64' b'\x65\x37\x05\x4c' \
2186
 
+            b'\xa2\x16\xe9\x68' b'\x00\x00\x00\x00' \
2187
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2188
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2189
 
 
2190
 
 
2191
 
     def testPack0(self):
2192
 
-        bin = apply(event.ResizeRequest._fields.to_binary, (), self.evt_args_0)
2193
 
+        bin = event.ResizeRequest._fields.to_binary(*(), **self.evt_args_0)
2194
 
         try:
2195
 
             assert bin == self.evt_bin_0
2196
 
         except AssertionError:
2197
 
@@ -604,14 +606,14 @@
2198
 
             'state': 181,
2199
 
             'window': 334365400,
2200
 
             }
2201
 
-        self.evt_bin_0 = '\xbc\x00\x73\xe6' '\x13\xee\x02\xd8' \
2202
 
-            '\x2d\x74\x24\x38' '\x6a\xc2\x4b\x25' \
2203
 
-            '\xb5\x00\x00\x00' '\x00\x00\x00\x00' \
2204
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2205
 
+        self.evt_bin_0 = b'\xbc\x00\x73\xe6' b'\x13\xee\x02\xd8' \
2206
 
+            b'\x2d\x74\x24\x38' b'\x6a\xc2\x4b\x25' \
2207
 
+            b'\xb5\x00\x00\x00' b'\x00\x00\x00\x00' \
2208
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2209
 
 
2210
 
 
2211
 
     def testPack0(self):
2212
 
-        bin = apply(event.PropertyNotify._fields.to_binary, (), self.evt_args_0)
2213
 
+        bin = event.PropertyNotify._fields.to_binary(*(), **self.evt_args_0)
2214
 
         try:
2215
 
             assert bin == self.evt_bin_0
2216
 
         except AssertionError:
2217
 
@@ -638,14 +640,14 @@
2218
 
             'type': 170,
2219
 
             'window': 355039782,
2220
 
             }
2221
 
-        self.evt_bin_0 = '\xaa\x00\x35\x7b' '\x22\x74\xca\x43' \
2222
 
-            '\x15\x29\x7a\x26' '\x52\x94\x54\x73' \
2223
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2224
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2225
 
+        self.evt_bin_0 = b'\xaa\x00\x35\x7b' b'\x22\x74\xca\x43' \
2226
 
+            b'\x15\x29\x7a\x26' b'\x52\x94\x54\x73' \
2227
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2228
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2229
 
 
2230
 
 
2231
 
     def testPack0(self):
2232
 
-        bin = apply(event.SelectionClear._fields.to_binary, (), self.evt_args_0)
2233
 
+        bin = event.SelectionClear._fields.to_binary(*(), **self.evt_args_0)
2234
 
         try:
2235
 
             assert bin == self.evt_bin_0
2236
 
         except AssertionError:
2237
 
@@ -675,14 +677,14 @@
2238
 
             'selection': 1972323175,
2239
 
             'requestor': 178195168,
2240
 
             }
2241
 
-        self.evt_bin_0 = '\xa2\x00\x33\xc6' '\x44\xd2\x57\x9a' \
2242
 
-            '\x7b\xba\xc5\x57' '\x0a\x9f\x0a\xe0' \
2243
 
-            '\x75\x8f\x43\x67' '\x4e\x3b\xb0\x83' \
2244
 
-            '\x17\xac\x30\xe9' '\x00\x00\x00\x00'
2245
 
+        self.evt_bin_0 = b'\xa2\x00\x33\xc6' b'\x44\xd2\x57\x9a' \
2246
 
+            b'\x7b\xba\xc5\x57' b'\x0a\x9f\x0a\xe0' \
2247
 
+            b'\x75\x8f\x43\x67' b'\x4e\x3b\xb0\x83' \
2248
 
+            b'\x17\xac\x30\xe9' b'\x00\x00\x00\x00'
2249
 
 
2250
 
 
2251
 
     def testPack0(self):
2252
 
-        bin = apply(event.SelectionRequest._fields.to_binary, (), self.evt_args_0)
2253
 
+        bin = event.SelectionRequest._fields.to_binary(*(), **self.evt_args_0)
2254
 
         try:
2255
 
             assert bin == self.evt_bin_0
2256
 
         except AssertionError:
2257
 
@@ -711,14 +713,14 @@
2258
 
             'selection': 781895626,
2259
 
             'requestor': 1242076588,
2260
 
             }
2261
 
-        self.evt_bin_0 = '\xc7\x00\x9b\x38' '\x34\x95\x2f\x5e' \
2262
 
-            '\x4a\x08\x95\xac' '\x2e\x9a\xc7\xca' \
2263
 
-            '\x7f\x0b\x8a\x2d' '\x12\x05\xd7\x93' \
2264
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2265
 
+        self.evt_bin_0 = b'\xc7\x00\x9b\x38' b'\x34\x95\x2f\x5e' \
2266
 
+            b'\x4a\x08\x95\xac' b'\x2e\x9a\xc7\xca' \
2267
 
+            b'\x7f\x0b\x8a\x2d' b'\x12\x05\xd7\x93' \
2268
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2269
 
 
2270
 
 
2271
 
     def testPack0(self):
2272
 
-        bin = apply(event.SelectionNotify._fields.to_binary, (), self.evt_args_0)
2273
 
+        bin = event.SelectionNotify._fields.to_binary(*(), **self.evt_args_0)
2274
 
         try:
2275
 
             assert bin == self.evt_bin_0
2276
 
         except AssertionError:
2277
 
@@ -746,14 +748,14 @@
2278
 
             'window': 1591667531,
2279
 
             'new': 1,
2280
 
             }
2281
 
-        self.evt_bin_0 = '\xe9\x00\xf5\xb6' '\x5e\xde\xeb\x4b' \
2282
 
-            '\x11\xed\xd7\x06' '\x01\xd1\x00\x00' \
2283
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2284
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2285
 
+        self.evt_bin_0 = b'\xe9\x00\xf5\xb6' b'\x5e\xde\xeb\x4b' \
2286
 
+            b'\x11\xed\xd7\x06' b'\x01\xd1\x00\x00' \
2287
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2288
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2289
 
 
2290
 
 
2291
 
     def testPack0(self):
2292
 
-        bin = apply(event.ColormapNotify._fields.to_binary, (), self.evt_args_0)
2293
 
+        bin = event.ColormapNotify._fields.to_binary(*(), **self.evt_args_0)
2294
 
         try:
2295
 
             assert bin == self.evt_bin_0
2296
 
         except AssertionError:
2297
 
@@ -780,10 +782,10 @@
2298
 
             'client_type': 1340394836,
2299
 
             'window': 1256861040,
2300
 
             }
2301
 
-        self.evt_bin_0 = '\xf5\x08\xbe\x48' '\x4a\xea\x2d\x70' \
2302
 
-            '\x4f\xe4\xcd\x54' '\x30\x31\x32\x33' \
2303
 
-            '\x34\x35\x36\x37' '\x38\x39\x30\x31' \
2304
 
-            '\x32\x33\x34\x35' '\x36\x37\x38\x39'
2305
 
+        self.evt_bin_0 = b'\xf5\x08\xbe\x48' b'\x4a\xea\x2d\x70' \
2306
 
+            b'\x4f\xe4\xcd\x54' b'\x30\x31\x32\x33' \
2307
 
+            b'\x34\x35\x36\x37' b'\x38\x39\x30\x31' \
2308
 
+            b'\x32\x33\x34\x35' b'\x36\x37\x38\x39'
2309
 
 
2310
 
         self.evt_args_1 = {
2311
 
             'sequence_number': 62804,
2312
 
@@ -792,10 +794,10 @@
2313
 
             'client_type': 214585025,
2314
 
             'window': 151327338,
2315
 
             }
2316
 
-        self.evt_bin_1 = '\xfa\x10\xf5\x54' '\x09\x05\x12\x6a' \
2317
 
-            '\x0c\xca\x4e\xc1' '\x00\x01\x00\x02' \
2318
 
-            '\x00\x03\x00\x04' '\x00\x05\x00\x06' \
2319
 
-            '\x00\x07\x00\x08' '\x00\x09\x00\x0a'
2320
 
+        self.evt_bin_1 = b'\xfa\x10\xf5\x54' b'\x09\x05\x12\x6a' \
2321
 
+            b'\x0c\xca\x4e\xc1' b'\x00\x01\x00\x02' \
2322
 
+            b'\x00\x03\x00\x04' b'\x00\x05\x00\x06' \
2323
 
+            b'\x00\x07\x00\x08' b'\x00\x09\x00\x0a'
2324
 
 
2325
 
         self.evt_args_2 = {
2326
 
             'sequence_number': 3122,
2327
 
@@ -804,14 +806,14 @@
2328
 
             'client_type': 698151018,
2329
 
             'window': 725159371,
2330
 
             }
2331
 
-        self.evt_bin_2 = '\xf3\x20\x0c\x32' '\x2b\x39\x0d\xcb' \
2332
 
-            '\x29\x9c\xf0\x6a' '\x00\x00\x00\x01' \
2333
 
-            '\x00\x00\x00\x02' '\x00\x00\x00\x03' \
2334
 
-            '\x00\x00\x00\x04' '\x00\x00\x00\x05'
2335
 
+        self.evt_bin_2 = b'\xf3\x20\x0c\x32' b'\x2b\x39\x0d\xcb' \
2336
 
+            b'\x29\x9c\xf0\x6a' b'\x00\x00\x00\x01' \
2337
 
+            b'\x00\x00\x00\x02' b'\x00\x00\x00\x03' \
2338
 
+            b'\x00\x00\x00\x04' b'\x00\x00\x00\x05'
2339
 
 
2340
 
 
2341
 
     def testPack0(self):
2342
 
-        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_0)
2343
 
+        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_0)
2344
 
         try:
2345
 
             assert bin == self.evt_bin_0
2346
 
         except AssertionError:
2347
 
@@ -829,7 +831,7 @@
2348
 
             raise AssertionError(args)
2349
 
 
2350
 
     def testPack1(self):
2351
 
-        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_1)
2352
 
+        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_1)
2353
 
         try:
2354
 
             assert bin == self.evt_bin_1
2355
 
         except AssertionError:
2356
 
@@ -847,7 +849,7 @@
2357
 
             raise AssertionError(args)
2358
 
 
2359
 
     def testPack2(self):
2360
 
-        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_2)
2361
 
+        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_2)
2362
 
         try:
2363
 
             assert bin == self.evt_bin_2
2364
 
         except AssertionError:
2365
 
@@ -874,14 +876,14 @@
2366
 
             'type': 252,
2367
 
             'first_keycode': 218,
2368
 
             }
2369
 
-        self.evt_bin_0 = '\xfc\x00\xd1\x25' '\x8d\xda\x97\x00' \
2370
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2371
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2372
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2373
 
+        self.evt_bin_0 = b'\xfc\x00\xd1\x25' b'\x8d\xda\x97\x00' \
2374
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2375
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2376
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2377
 
 
2378
 
 
2379
 
     def testPack0(self):
2380
 
-        bin = apply(event.MappingNotify._fields.to_binary, (), self.evt_args_0)
2381
 
+        bin = event.MappingNotify._fields.to_binary(*(), **self.evt_args_0)
2382
 
         try:
2383
 
             assert bin == self.evt_bin_0
2384
 
         except AssertionError:
2385
 
Index: python-xlib-0.14+20091101/test/test_events_le.py
2386
 
===================================================================
2387
 
--- python-xlib-0.14+20091101.orig/test/test_events_le.py       2013-10-11 14:19:21.117971349 -0400
2388
 
+++ python-xlib-0.14+20091101/test/test_events_le.py    2013-10-11 14:19:21.101971349 -0400
2389
 
@@ -3,7 +3,6 @@
2390
 
 import sys, os
2391
 
 sys.path.insert(1, os.path.join(sys.path[0], '..'))
2392
 
 
2393
 
-import string
2394
 
 import unittest
2395
 
 from Xlib.protocol import request, rq, event
2396
 
 import Xlib.protocol.event
2397
 
@@ -13,7 +12,7 @@
2398
 
 
2399
 
 class CmpArray:
2400
 
     def __init__(self, *args, **kws):
2401
 
-        self.array = apply(array.array, args, kws)
2402
 
+        self.array = array.array(*args, **kws)
2403
 
 
2404
 
     def __len__(self):
2405
 
         return len(self.array)
2406
 
@@ -24,13 +23,16 @@
2407
 
     def __getattr__(self, attr):
2408
 
         return getattr(self.array, attr)
2409
 
 
2410
 
-    def __cmp__(self, other):
2411
 
-        return cmp(self.array.tolist(), other)
2412
 
+    def __eq__(self, other):
2413
 
+        return self.array.tolist() == other
2414
 
+
2415
 
+    def __ne__(self, other):
2416
 
+        return self.array.tolist() != other
2417
 
 
2418
 
 rq.array = CmpArray
2419
 
 
2420
 
 def tohex(bin):
2421
 
-    bin = string.join(map(lambda c: '\\x%02x' % ord(c), bin), '')
2422
 
+    bin = ''.join(map(lambda c: '\\x%02x' % c, bin))
2423
 
 
2424
 
     bins = []
2425
 
     for i in range(0, len(bin), 16):
2426
 
@@ -43,7 +45,7 @@
2427
 
         except IndexError:
2428
 
             bins2.append("'%s'" % bins[i])
2429
 
 
2430
 
-    return string.join(bins2, ' \\\n            ')
2431
 
+    return ' \\\n            '.join(bins2)
2432
 
 
2433
 
 class DummyDisplay:
2434
 
     def get_resource_class(self, x):
2435
 
@@ -66,14 +68,14 @@
2436
 
             'type': 173,
2437
 
             'data': [130, 181, 177, 244, 167, 144, 216, 185, 228, 220, 254, 130, 239, 213, 142, 240, 233, 248, 161, 238, 160, 205, 212, 205, 166, 156, 241, 169, 198, 147, 144],
2438
 
             }
2439
 
-        self.evt_bin_0 = '\xad\x82\xb5\xb1' '\xf4\xa7\x90\xd8' \
2440
 
-            '\xb9\xe4\xdc\xfe' '\x82\xef\xd5\x8e' \
2441
 
-            '\xf0\xe9\xf8\xa1' '\xee\xa0\xcd\xd4' \
2442
 
-            '\xcd\xa6\x9c\xf1' '\xa9\xc6\x93\x90'
2443
 
+        self.evt_bin_0 = b'\xad\x82\xb5\xb1' b'\xf4\xa7\x90\xd8' \
2444
 
+            b'\xb9\xe4\xdc\xfe' b'\x82\xef\xd5\x8e' \
2445
 
+            b'\xf0\xe9\xf8\xa1' b'\xee\xa0\xcd\xd4' \
2446
 
+            b'\xcd\xa6\x9c\xf1' b'\xa9\xc6\x93\x90'
2447
 
 
2448
 
 
2449
 
     def testPack0(self):
2450
 
-        bin = apply(event.KeymapNotify._fields.to_binary, (), self.evt_args_0)
2451
 
+        bin = event.KeymapNotify._fields.to_binary(*(), **self.evt_args_0)
2452
 
         try:
2453
 
             assert bin == self.evt_bin_0
2454
 
         except AssertionError:
2455
 
@@ -103,14 +105,14 @@
2456
 
             'sequence_number': 45668,
2457
 
             'height': 29709,
2458
 
             }
2459
 
-        self.evt_bin_0 = '\xc0\x00\x64\xb2' '\xb0\x95\xcc\x76' \
2460
 
-            '\x24\x3d\xe2\x71' '\xc0\xde\x0d\x74' \
2461
 
-            '\x57\x79\x00\x00' '\x00\x00\x00\x00' \
2462
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2463
 
+        self.evt_bin_0 = b'\xc0\x00\x64\xb2' b'\xb0\x95\xcc\x76' \
2464
 
+            b'\x24\x3d\xe2\x71' b'\xc0\xde\x0d\x74' \
2465
 
+            b'\x57\x79\x00\x00' b'\x00\x00\x00\x00' \
2466
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2467
 
 
2468
 
 
2469
 
     def testPack0(self):
2470
 
-        bin = apply(event.Expose._fields.to_binary, (), self.evt_args_0)
2471
 
+        bin = event.Expose._fields.to_binary(*(), **self.evt_args_0)
2472
 
         try:
2473
 
             assert bin == self.evt_bin_0
2474
 
         except AssertionError:
2475
 
@@ -142,14 +144,14 @@
2476
 
             'sequence_number': 9516,
2477
 
             'height': 10465,
2478
 
             }
2479
 
-        self.evt_bin_0 = '\x8a\x00\x2c\x25' '\xb1\xf4\xa7\x38' \
2480
 
-            '\x79\xc3\x6c\x09' '\x92\x54\xe1\x28' \
2481
 
-            '\x50\xad\x5a\x1b' '\xee\x00\x00\x00' \
2482
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2483
 
+        self.evt_bin_0 = b'\x8a\x00\x2c\x25' b'\xb1\xf4\xa7\x38' \
2484
 
+            b'\x79\xc3\x6c\x09' b'\x92\x54\xe1\x28' \
2485
 
+            b'\x50\xad\x5a\x1b' b'\xee\x00\x00\x00' \
2486
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2487
 
 
2488
 
 
2489
 
     def testPack0(self):
2490
 
-        bin = apply(event.GraphicsExpose._fields.to_binary, (), self.evt_args_0)
2491
 
+        bin = event.GraphicsExpose._fields.to_binary(*(), **self.evt_args_0)
2492
 
         try:
2493
 
             assert bin == self.evt_bin_0
2494
 
         except AssertionError:
2495
 
@@ -176,14 +178,14 @@
2496
 
             'major_event': 149,
2497
 
             'sequence_number': 51301,
2498
 
             }
2499
 
-        self.evt_bin_0 = '\xc6\x00\x65\xc8' '\x22\x92\xd6\x52' \
2500
 
-            '\xa2\xbf\x95\x00' '\x00\x00\x00\x00' \
2501
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2502
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2503
 
+        self.evt_bin_0 = b'\xc6\x00\x65\xc8' b'\x22\x92\xd6\x52' \
2504
 
+            b'\xa2\xbf\x95\x00' b'\x00\x00\x00\x00' \
2505
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2506
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2507
 
 
2508
 
 
2509
 
     def testPack0(self):
2510
 
-        bin = apply(event.NoExpose._fields.to_binary, (), self.evt_args_0)
2511
 
+        bin = event.NoExpose._fields.to_binary(*(), **self.evt_args_0)
2512
 
         try:
2513
 
             assert bin == self.evt_bin_0
2514
 
         except AssertionError:
2515
 
@@ -209,14 +211,14 @@
2516
 
             'state': 239,
2517
 
             'sequence_number': 38248,
2518
 
             }
2519
 
-        self.evt_bin_0 = '\xe9\x00\x68\x95' '\x72\xac\x93\x32' \
2520
 
-            '\xef\x00\x00\x00' '\x00\x00\x00\x00' \
2521
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2522
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2523
 
+        self.evt_bin_0 = b'\xe9\x00\x68\x95' b'\x72\xac\x93\x32' \
2524
 
+            b'\xef\x00\x00\x00' b'\x00\x00\x00\x00' \
2525
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2526
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2527
 
 
2528
 
 
2529
 
     def testPack0(self):
2530
 
-        bin = apply(event.VisibilityNotify._fields.to_binary, (), self.evt_args_0)
2531
 
+        bin = event.VisibilityNotify._fields.to_binary(*(), **self.evt_args_0)
2532
 
         try:
2533
 
             assert bin == self.evt_bin_0
2534
 
         except AssertionError:
2535
 
@@ -248,14 +250,14 @@
2536
 
             'sequence_number': 14268,
2537
 
             'height': 8803,
2538
 
             }
2539
 
-        self.evt_bin_0 = '\xe6\x00\xbc\x37' '\x55\x6b\xb4\x06' \
2540
 
-            '\x58\x8e\x2b\x4f' '\x94\xca\x74\x85' \
2541
 
-            '\xef\x5f\x63\x22' '\x2c\x80\x00\x00' \
2542
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2543
 
+        self.evt_bin_0 = b'\xe6\x00\xbc\x37' b'\x55\x6b\xb4\x06' \
2544
 
+            b'\x58\x8e\x2b\x4f' b'\x94\xca\x74\x85' \
2545
 
+            b'\xef\x5f\x63\x22' b'\x2c\x80\x00\x00' \
2546
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2547
 
 
2548
 
 
2549
 
     def testPack0(self):
2550
 
-        bin = apply(event.CreateNotify._fields.to_binary, (), self.evt_args_0)
2551
 
+        bin = event.CreateNotify._fields.to_binary(*(), **self.evt_args_0)
2552
 
         try:
2553
 
             assert bin == self.evt_bin_0
2554
 
         except AssertionError:
2555
 
@@ -281,14 +283,14 @@
2556
 
             'event': 1596763581,
2557
 
             'sequence_number': 37839,
2558
 
             }
2559
 
-        self.evt_bin_0 = '\xb7\x00\xcf\x93' '\xbd\xad\x2c\x5f' \
2560
 
-            '\x39\xd4\x86\x52' '\x00\x00\x00\x00' \
2561
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2562
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2563
 
+        self.evt_bin_0 = b'\xb7\x00\xcf\x93' b'\xbd\xad\x2c\x5f' \
2564
 
+            b'\x39\xd4\x86\x52' b'\x00\x00\x00\x00' \
2565
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2566
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2567
 
 
2568
 
 
2569
 
     def testPack0(self):
2570
 
-        bin = apply(event.DestroyNotify._fields.to_binary, (), self.evt_args_0)
2571
 
+        bin = event.DestroyNotify._fields.to_binary(*(), **self.evt_args_0)
2572
 
         try:
2573
 
             assert bin == self.evt_bin_0
2574
 
         except AssertionError:
2575
 
@@ -315,14 +317,14 @@
2576
 
             'sequence_number': 55135,
2577
 
             'from_configure': 0,
2578
 
             }
2579
 
-        self.evt_bin_0 = '\xc0\x00\x5f\xd7' '\x1a\x88\x73\x36' \
2580
 
-            '\xf4\xb1\x87\x4b' '\x00\x00\x00\x00' \
2581
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2582
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2583
 
+        self.evt_bin_0 = b'\xc0\x00\x5f\xd7' b'\x1a\x88\x73\x36' \
2584
 
+            b'\xf4\xb1\x87\x4b' b'\x00\x00\x00\x00' \
2585
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2586
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2587
 
 
2588
 
 
2589
 
     def testPack0(self):
2590
 
-        bin = apply(event.UnmapNotify._fields.to_binary, (), self.evt_args_0)
2591
 
+        bin = event.UnmapNotify._fields.to_binary(*(), **self.evt_args_0)
2592
 
         try:
2593
 
             assert bin == self.evt_bin_0
2594
 
         except AssertionError:
2595
 
@@ -349,14 +351,14 @@
2596
 
             'event': 1566597012,
2597
 
             'sequence_number': 8920,
2598
 
             }
2599
 
-        self.evt_bin_0 = '\xd8\x00\xd8\x22' '\x94\x5f\x60\x5d' \
2600
 
-            '\xe8\xb1\x5a\x77' '\x00\x00\x00\x00' \
2601
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2602
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2603
 
+        self.evt_bin_0 = b'\xd8\x00\xd8\x22' b'\x94\x5f\x60\x5d' \
2604
 
+            b'\xe8\xb1\x5a\x77' b'\x00\x00\x00\x00' \
2605
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2606
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2607
 
 
2608
 
 
2609
 
     def testPack0(self):
2610
 
-        bin = apply(event.MapNotify._fields.to_binary, (), self.evt_args_0)
2611
 
+        bin = event.MapNotify._fields.to_binary(*(), **self.evt_args_0)
2612
 
         try:
2613
 
             assert bin == self.evt_bin_0
2614
 
         except AssertionError:
2615
 
@@ -382,14 +384,14 @@
2616
 
             'parent': 1188866605,
2617
 
             'sequence_number': 6729,
2618
 
             }
2619
 
-        self.evt_bin_0 = '\xf2\x00\x49\x1a' '\x2d\xaa\xdc\x46' \
2620
 
-            '\x4d\x6b\xba\x67' '\x00\x00\x00\x00' \
2621
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2622
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2623
 
+        self.evt_bin_0 = b'\xf2\x00\x49\x1a' b'\x2d\xaa\xdc\x46' \
2624
 
+            b'\x4d\x6b\xba\x67' b'\x00\x00\x00\x00' \
2625
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2626
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2627
 
 
2628
 
 
2629
 
     def testPack0(self):
2630
 
-        bin = apply(event.MapRequest._fields.to_binary, (), self.evt_args_0)
2631
 
+        bin = event.MapRequest._fields.to_binary(*(), **self.evt_args_0)
2632
 
         try:
2633
 
             assert bin == self.evt_bin_0
2634
 
         except AssertionError:
2635
 
@@ -419,14 +421,14 @@
2636
 
             'event': 1344092894,
2637
 
             'sequence_number': 31034,
2638
 
             }
2639
 
-        self.evt_bin_0 = '\xb9\x00\x3a\x79' '\xde\x3a\x1d\x50' \
2640
 
-            '\xff\xf9\xc4\x36' '\x1e\x3e\x65\x3e' \
2641
 
-            '\xda\xd1\xfd\xd5' '\x00\x00\x00\x00' \
2642
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2643
 
+        self.evt_bin_0 = b'\xb9\x00\x3a\x79' b'\xde\x3a\x1d\x50' \
2644
 
+            b'\xff\xf9\xc4\x36' b'\x1e\x3e\x65\x3e' \
2645
 
+            b'\xda\xd1\xfd\xd5' b'\x00\x00\x00\x00' \
2646
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2647
 
 
2648
 
 
2649
 
     def testPack0(self):
2650
 
-        bin = apply(event.ReparentNotify._fields.to_binary, (), self.evt_args_0)
2651
 
+        bin = event.ReparentNotify._fields.to_binary(*(), **self.evt_args_0)
2652
 
         try:
2653
 
             assert bin == self.evt_bin_0
2654
 
         except AssertionError:
2655
 
@@ -459,14 +461,14 @@
2656
 
             'event': 2102634753,
2657
 
             'sequence_number': 21818,
2658
 
             }
2659
 
-        self.evt_bin_0 = '\xbf\x00\x3a\x55' '\x01\xa9\x53\x7d' \
2660
 
-            '\xe9\xba\x4c\x65' '\x29\x26\x2f\x44' \
2661
 
-            '\x5f\xa3\xb9\x80' '\x7f\x5e\x4d\xad' \
2662
 
-            '\x55\xca\x01\x00' '\x00\x00\x00\x00'
2663
 
+        self.evt_bin_0 = b'\xbf\x00\x3a\x55' b'\x01\xa9\x53\x7d' \
2664
 
+            b'\xe9\xba\x4c\x65' b'\x29\x26\x2f\x44' \
2665
 
+            b'\x5f\xa3\xb9\x80' b'\x7f\x5e\x4d\xad' \
2666
 
+            b'\x55\xca\x01\x00' b'\x00\x00\x00\x00'
2667
 
 
2668
 
 
2669
 
     def testPack0(self):
2670
 
-        bin = apply(event.ConfigureNotify._fields.to_binary, (), self.evt_args_0)
2671
 
+        bin = event.ConfigureNotify._fields.to_binary(*(), **self.evt_args_0)
2672
 
         try:
2673
 
             assert bin == self.evt_bin_0
2674
 
         except AssertionError:
2675
 
@@ -500,14 +502,14 @@
2676
 
             'type': 140,
2677
 
             'sequence_number': 48820,
2678
 
             }
2679
 
-        self.evt_bin_0 = '\x8c\x9b\xb4\xbe' '\xfc\xc8\x80\x58' \
2680
 
-            '\xdd\x64\xbd\x20' '\xfe\xe2\xc1\x44' \
2681
 
-            '\xfc\xd2\x05\xfc' '\x4a\xb6\x90\x6a' \
2682
 
-            '\x53\xa1\x1b\xa3' '\x00\x00\x00\x00'
2683
 
+        self.evt_bin_0 = b'\x8c\x9b\xb4\xbe' b'\xfc\xc8\x80\x58' \
2684
 
+            b'\xdd\x64\xbd\x20' b'\xfe\xe2\xc1\x44' \
2685
 
+            b'\xfc\xd2\x05\xfc' b'\x4a\xb6\x90\x6a' \
2686
 
+            b'\x53\xa1\x1b\xa3' b'\x00\x00\x00\x00'
2687
 
 
2688
 
 
2689
 
     def testPack0(self):
2690
 
-        bin = apply(event.ConfigureRequest._fields.to_binary, (), self.evt_args_0)
2691
 
+        bin = event.ConfigureRequest._fields.to_binary(*(), **self.evt_args_0)
2692
 
         try:
2693
 
             assert bin == self.evt_bin_0
2694
 
         except AssertionError:
2695
 
@@ -535,14 +537,14 @@
2696
 
             'event': 860169186,
2697
 
             'sequence_number': 48472,
2698
 
             }
2699
 
-        self.evt_bin_0 = '\xbf\x00\x58\xbd' '\xe2\x23\x45\x33' \
2700
 
-            '\x38\x1b\xb0\x57' '\x7e\xd5\x27\x97' \
2701
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2702
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2703
 
+        self.evt_bin_0 = b'\xbf\x00\x58\xbd' b'\xe2\x23\x45\x33' \
2704
 
+            b'\x38\x1b\xb0\x57' b'\x7e\xd5\x27\x97' \
2705
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2706
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2707
 
 
2708
 
 
2709
 
     def testPack0(self):
2710
 
-        bin = apply(event.GravityNotify._fields.to_binary, (), self.evt_args_0)
2711
 
+        bin = event.GravityNotify._fields.to_binary(*(), **self.evt_args_0)
2712
 
         try:
2713
 
             assert bin == self.evt_bin_0
2714
 
         except AssertionError:
2715
 
@@ -569,14 +571,14 @@
2716
 
             'sequence_number': 9443,
2717
 
             'height': 58942,
2718
 
             }
2719
 
-        self.evt_bin_0 = '\x8b\x00\xe3\x24' '\x73\xcf\x4f\x3b' \
2720
 
-            '\x8a\x22\x3e\xe6' '\x00\x00\x00\x00' \
2721
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2722
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2723
 
+        self.evt_bin_0 = b'\x8b\x00\xe3\x24' b'\x73\xcf\x4f\x3b' \
2724
 
+            b'\x8a\x22\x3e\xe6' b'\x00\x00\x00\x00' \
2725
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2726
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2727
 
 
2728
 
 
2729
 
     def testPack0(self):
2730
 
-        bin = apply(event.ResizeRequest._fields.to_binary, (), self.evt_args_0)
2731
 
+        bin = event.ResizeRequest._fields.to_binary(*(), **self.evt_args_0)
2732
 
         try:
2733
 
             assert bin == self.evt_bin_0
2734
 
         except AssertionError:
2735
 
@@ -604,14 +606,14 @@
2736
 
             'state': 241,
2737
 
             'sequence_number': 47586,
2738
 
             }
2739
 
-        self.evt_bin_0 = '\xcd\x00\xe2\xb9' '\xbe\x45\x1b\x69' \
2740
 
-            '\x60\x2c\xd0\x02' '\xca\x79\xd2\x37' \
2741
 
-            '\xf1\x00\x00\x00' '\x00\x00\x00\x00' \
2742
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2743
 
+        self.evt_bin_0 = b'\xcd\x00\xe2\xb9' b'\xbe\x45\x1b\x69' \
2744
 
+            b'\x60\x2c\xd0\x02' b'\xca\x79\xd2\x37' \
2745
 
+            b'\xf1\x00\x00\x00' b'\x00\x00\x00\x00' \
2746
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2747
 
 
2748
 
 
2749
 
     def testPack0(self):
2750
 
-        bin = apply(event.PropertyNotify._fields.to_binary, (), self.evt_args_0)
2751
 
+        bin = event.PropertyNotify._fields.to_binary(*(), **self.evt_args_0)
2752
 
         try:
2753
 
             assert bin == self.evt_bin_0
2754
 
         except AssertionError:
2755
 
@@ -638,14 +640,14 @@
2756
 
             'sequence_number': 26660,
2757
 
             'time': 1732839301,
2758
 
             }
2759
 
-        self.evt_bin_0 = '\xe8\x00\x24\x68' '\x85\x07\x49\x67' \
2760
 
-            '\x51\x65\x0b\x14' '\xff\x27\x49\x0f' \
2761
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2762
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2763
 
+        self.evt_bin_0 = b'\xe8\x00\x24\x68' b'\x85\x07\x49\x67' \
2764
 
+            b'\x51\x65\x0b\x14' b'\xff\x27\x49\x0f' \
2765
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2766
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2767
 
 
2768
 
 
2769
 
     def testPack0(self):
2770
 
-        bin = apply(event.SelectionClear._fields.to_binary, (), self.evt_args_0)
2771
 
+        bin = event.SelectionClear._fields.to_binary(*(), **self.evt_args_0)
2772
 
         try:
2773
 
             assert bin == self.evt_bin_0
2774
 
         except AssertionError:
2775
 
@@ -675,14 +677,14 @@
2776
 
             'type': 147,
2777
 
             'sequence_number': 20571,
2778
 
             }
2779
 
-        self.evt_bin_0 = '\x93\x00\x5b\x50' '\xe9\x35\xda\x54' \
2780
 
-            '\xf3\x3e\x97\x2d' '\x41\xc6\xca\x0f' \
2781
 
-            '\xc0\x1f\x8c\x5b' '\x07\xdb\x38\x24' \
2782
 
-            '\x26\x99\x6e\x44' '\x00\x00\x00\x00'
2783
 
+        self.evt_bin_0 = b'\x93\x00\x5b\x50' b'\xe9\x35\xda\x54' \
2784
 
+            b'\xf3\x3e\x97\x2d' b'\x41\xc6\xca\x0f' \
2785
 
+            b'\xc0\x1f\x8c\x5b' b'\x07\xdb\x38\x24' \
2786
 
+            b'\x26\x99\x6e\x44' b'\x00\x00\x00\x00'
2787
 
 
2788
 
 
2789
 
     def testPack0(self):
2790
 
-        bin = apply(event.SelectionRequest._fields.to_binary, (), self.evt_args_0)
2791
 
+        bin = event.SelectionRequest._fields.to_binary(*(), **self.evt_args_0)
2792
 
         try:
2793
 
             assert bin == self.evt_bin_0
2794
 
         except AssertionError:
2795
 
@@ -711,14 +713,14 @@
2796
 
             'type': 133,
2797
 
             'sequence_number': 30741,
2798
 
             }
2799
 
-        self.evt_bin_0 = '\x85\x00\x15\x78' '\xab\x44\xee\x3c' \
2800
 
-            '\xb1\x59\xe8\x39' '\x06\x6d\x83\x13' \
2801
 
-            '\xd1\xfe\xb7\x6f' '\xbe\x02\xcd\x6a' \
2802
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2803
 
+        self.evt_bin_0 = b'\x85\x00\x15\x78' b'\xab\x44\xee\x3c' \
2804
 
+            b'\xb1\x59\xe8\x39' b'\x06\x6d\x83\x13' \
2805
 
+            b'\xd1\xfe\xb7\x6f' b'\xbe\x02\xcd\x6a' \
2806
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2807
 
 
2808
 
 
2809
 
     def testPack0(self):
2810
 
-        bin = apply(event.SelectionNotify._fields.to_binary, (), self.evt_args_0)
2811
 
+        bin = event.SelectionNotify._fields.to_binary(*(), **self.evt_args_0)
2812
 
         try:
2813
 
             assert bin == self.evt_bin_0
2814
 
         except AssertionError:
2815
 
@@ -746,14 +748,14 @@
2816
 
             'state': 168,
2817
 
             'sequence_number': 8684,
2818
 
             }
2819
 
-        self.evt_bin_0 = '\xd3\x00\xec\x21' '\xbb\x4b\xb1\x50' \
2820
 
-            '\x9d\xab\x52\x27' '\x01\xa8\x00\x00' \
2821
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2822
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2823
 
+        self.evt_bin_0 = b'\xd3\x00\xec\x21' b'\xbb\x4b\xb1\x50' \
2824
 
+            b'\x9d\xab\x52\x27' b'\x01\xa8\x00\x00' \
2825
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2826
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2827
 
 
2828
 
 
2829
 
     def testPack0(self):
2830
 
-        bin = apply(event.ColormapNotify._fields.to_binary, (), self.evt_args_0)
2831
 
+        bin = event.ColormapNotify._fields.to_binary(*(), **self.evt_args_0)
2832
 
         try:
2833
 
             assert bin == self.evt_bin_0
2834
 
         except AssertionError:
2835
 
@@ -780,10 +782,10 @@
2836
 
             'data': (8, '01234567890123456789'),
2837
 
             'sequence_number': 14854,
2838
 
             }
2839
 
-        self.evt_bin_0 = '\xed\x08\x06\x3a' '\x82\xab\x90\x6b' \
2840
 
-            '\x49\x39\x23\x1b' '\x30\x31\x32\x33' \
2841
 
-            '\x34\x35\x36\x37' '\x38\x39\x30\x31' \
2842
 
-            '\x32\x33\x34\x35' '\x36\x37\x38\x39'
2843
 
+        self.evt_bin_0 = b'\xed\x08\x06\x3a' b'\x82\xab\x90\x6b' \
2844
 
+            b'\x49\x39\x23\x1b' b'\x30\x31\x32\x33' \
2845
 
+            b'\x34\x35\x36\x37' b'\x38\x39\x30\x31' \
2846
 
+            b'\x32\x33\x34\x35' b'\x36\x37\x38\x39'
2847
 
 
2848
 
         self.evt_args_1 = {
2849
 
             'type': 160,
2850
 
@@ -792,10 +794,10 @@
2851
 
             'data': (16, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
2852
 
             'sequence_number': 28171,
2853
 
             }
2854
 
-        self.evt_bin_1 = '\xa0\x10\x0b\x6e' '\x3e\xb2\x8e\x38' \
2855
 
-            '\xac\x66\xa7\x0c' '\x01\x00\x02\x00' \
2856
 
-            '\x03\x00\x04\x00' '\x05\x00\x06\x00' \
2857
 
-            '\x07\x00\x08\x00' '\x09\x00\x0a\x00'
2858
 
+        self.evt_bin_1 = b'\xa0\x10\x0b\x6e' b'\x3e\xb2\x8e\x38' \
2859
 
+            b'\xac\x66\xa7\x0c' b'\x01\x00\x02\x00' \
2860
 
+            b'\x03\x00\x04\x00' b'\x05\x00\x06\x00' \
2861
 
+            b'\x07\x00\x08\x00' b'\x09\x00\x0a\x00'
2862
 
 
2863
 
         self.evt_args_2 = {
2864
 
             'type': 243,
2865
 
@@ -804,14 +806,14 @@
2866
 
             'data': (32, [1, 2, 3, 4, 5]),
2867
 
             'sequence_number': 63569,
2868
 
             }
2869
 
-        self.evt_bin_2 = '\xf3\x20\x51\xf8' '\x46\x88\xaf\x22' \
2870
 
-            '\xfe\x65\xa1\x39' '\x01\x00\x00\x00' \
2871
 
-            '\x02\x00\x00\x00' '\x03\x00\x00\x00' \
2872
 
-            '\x04\x00\x00\x00' '\x05\x00\x00\x00'
2873
 
+        self.evt_bin_2 = b'\xf3\x20\x51\xf8' b'\x46\x88\xaf\x22' \
2874
 
+            b'\xfe\x65\xa1\x39' b'\x01\x00\x00\x00' \
2875
 
+            b'\x02\x00\x00\x00' b'\x03\x00\x00\x00' \
2876
 
+            b'\x04\x00\x00\x00' b'\x05\x00\x00\x00'
2877
 
 
2878
 
 
2879
 
     def testPack0(self):
2880
 
-        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_0)
2881
 
+        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_0)
2882
 
         try:
2883
 
             assert bin == self.evt_bin_0
2884
 
         except AssertionError:
2885
 
@@ -829,7 +831,7 @@
2886
 
             raise AssertionError(args)
2887
 
 
2888
 
     def testPack1(self):
2889
 
-        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_1)
2890
 
+        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_1)
2891
 
         try:
2892
 
             assert bin == self.evt_bin_1
2893
 
         except AssertionError:
2894
 
@@ -847,7 +849,7 @@
2895
 
             raise AssertionError(args)
2896
 
 
2897
 
     def testPack2(self):
2898
 
-        bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_2)
2899
 
+        bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_2)
2900
 
         try:
2901
 
             assert bin == self.evt_bin_2
2902
 
         except AssertionError:
2903
 
@@ -874,14 +876,14 @@
2904
 
             'count': 201,
2905
 
             'sequence_number': 32665,
2906
 
             }
2907
 
-        self.evt_bin_0 = '\xc6\x00\x99\x7f' '\xbd\xf6\xc9\x00' \
2908
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2909
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
2910
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
2911
 
+        self.evt_bin_0 = b'\xc6\x00\x99\x7f' b'\xbd\xf6\xc9\x00' \
2912
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2913
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
2914
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
2915
 
 
2916
 
 
2917
 
     def testPack0(self):
2918
 
-        bin = apply(event.MappingNotify._fields.to_binary, (), self.evt_args_0)
2919
 
+        bin = event.MappingNotify._fields.to_binary(*(), **self.evt_args_0)
2920
 
         try:
2921
 
             assert bin == self.evt_bin_0
2922
 
         except AssertionError:
2923
 
Index: python-xlib-0.14+20091101/test/test_requests_be.py
2924
 
===================================================================
2925
 
--- python-xlib-0.14+20091101.orig/test/test_requests_be.py     2013-10-11 14:19:21.117971349 -0400
2926
 
+++ python-xlib-0.14+20091101/test/test_requests_be.py  2013-10-11 14:19:21.105971349 -0400
2927
 
@@ -3,7 +3,6 @@
2928
 
 import sys, os
2929
 
 sys.path.insert(1, os.path.join(sys.path[0], '..'))
2930
 
 
2931
 
-import string
2932
 
 import unittest
2933
 
 from Xlib.protocol import request, rq, event
2934
 
 import Xlib.protocol.event
2935
 
@@ -13,7 +12,7 @@
2936
 
 
2937
 
 class CmpArray:
2938
 
     def __init__(self, *args, **kws):
2939
 
-        self.array = apply(array.array, args, kws)
2940
 
+        self.array = array.array(*args, **kws)
2941
 
 
2942
 
     def __len__(self):
2943
 
         return len(self.array)
2944
 
@@ -21,16 +20,25 @@
2945
 
     def __getslice__(self, x, y):
2946
 
         return list(self.array[x:y])
2947
 
 
2948
 
+    def __getitem__(self, n):
2949
 
+        if isinstance(n, slice):
2950
 
+            return list(self.array.__getitem__(n))
2951
 
+        else:
2952
 
+            return self.array[n]
2953
 
+
2954
 
     def __getattr__(self, attr):
2955
 
         return getattr(self.array, attr)
2956
 
 
2957
 
-    def __cmp__(self, other):
2958
 
-        return cmp(self.array.tolist(), other)
2959
 
+    def __eq__(self, other):
2960
 
+        return self.array.tolist() == other
2961
 
+
2962
 
+    def __ne__(self, other):
2963
 
+        return self.array.tolist() != other
2964
 
 
2965
 
 rq.array = CmpArray
2966
 
 
2967
 
 def tohex(bin):
2968
 
-    bin = string.join(map(lambda c: '\\x%02x' % ord(c), bin), '')
2969
 
+    bin = ''.join(map(lambda c: '\\x%02x' % c, bin))
2970
 
 
2971
 
     bins = []
2972
 
     for i in range(0, len(bin), 16):
2973
 
@@ -43,7 +51,7 @@
2974
 
         except IndexError:
2975
 
             bins2.append("'%s'" % bins[i])
2976
 
 
2977
 
-    return string.join(bins2, ' \\\n            ')
2978
 
+    return ' \\\n            '.join(bins2)
2979
 
 
2980
 
 class DummyDisplay:
2981
 
     def get_resource_class(self, x):
2982
 
@@ -75,22 +83,22 @@
2983
 
             'depth': 186,
2984
 
             'width': 51466,
2985
 
             }
2986
 
-        self.req_bin_0 = '\x01\xba\x00\x17' '\x6d\x03\x01\x24' \
2987
 
-            '\x74\xdb\x41\x4e' '\xae\xdd\xf0\x2f' \
2988
 
-            '\xc9\x0a\x96\xd0' '\x86\x93\x00\x00' \
2989
 
-            '\x17\xba\x10\x13' '\x00\x00\x7f\xff' \
2990
 
-            '\x5e\x67\x63\x43' '\x0c\x77\x07\x07' \
2991
 
-            '\x76\xc4\x0c\xaa' '\x7f\x48\x9d\x8c' \
2992
 
-            '\x00\x00\x00\x00' '\x03\x00\x00\x00' \
2993
 
-            '\x02\x00\x00\x00' '\x56\xac\x9b\x9d' \
2994
 
-            '\x21\x76\x49\x57' '\x00\x00\x00\x00' \
2995
 
-            '\x00\x00\x00\x00' '\x15\xf2\xee\x1c' \
2996
 
-            '\x23\x97\xad\x71' '\x16\x7e\xec\x01' \
2997
 
-            '\x55\xfd\xbc\xc5'
2998
 
+        self.req_bin_0 = b'\x01\xba\x00\x17' b'\x6d\x03\x01\x24' \
2999
 
+            b'\x74\xdb\x41\x4e' b'\xae\xdd\xf0\x2f' \
3000
 
+            b'\xc9\x0a\x96\xd0' b'\x86\x93\x00\x00' \
3001
 
+            b'\x17\xba\x10\x13' b'\x00\x00\x7f\xff' \
3002
 
+            b'\x5e\x67\x63\x43' b'\x0c\x77\x07\x07' \
3003
 
+            b'\x76\xc4\x0c\xaa' b'\x7f\x48\x9d\x8c' \
3004
 
+            b'\x00\x00\x00\x00' b'\x03\x00\x00\x00' \
3005
 
+            b'\x02\x00\x00\x00' b'\x56\xac\x9b\x9d' \
3006
 
+            b'\x21\x76\x49\x57' b'\x00\x00\x00\x00' \
3007
 
+            b'\x00\x00\x00\x00' b'\x15\xf2\xee\x1c' \
3008
 
+            b'\x23\x97\xad\x71' b'\x16\x7e\xec\x01' \
3009
 
+            b'\x55\xfd\xbc\xc5'
3010
 
 
3011
 
 
3012
 
     def testPackRequest0(self):
3013
 
-        bin = apply(request.CreateWindow._request.to_binary, (), self.req_args_0)
3014
 
+        bin = request.CreateWindow._request.to_binary(*(), **self.req_args_0)
3015
 
         try:
3016
 
             assert bin == self.req_bin_0
3017
 
         except AssertionError:
3018
 
@@ -114,19 +122,19 @@
3019
 
             'window': 1813552124,
3020
 
             'attrs': {'backing_pixel': 59516078, 'cursor': 1682969315, 'background_pixmap': 370313360, 'border_pixmap': 1158771722, 'backing_planes': 1432315664, 'win_gravity': 3, 'backing_store': 1, 'event_mask': 1054128649, 'save_under': 0, 'background_pixel': 1953340842, 'colormap': 1462101672, 'border_pixel': 287436510, 'bit_gravity': 10, 'do_not_propagate_mask': 1283834625, 'override_redirect': 0},
3021
 
             }
3022
 
-        self.req_bin_0 = '\x02\x00\x00\x12' '\x6c\x18\x9b\xfc' \
3023
 
-            '\x00\x00\x7f\xff' '\x16\x12\x88\x90' \
3024
 
-            '\x74\x6d\x9d\xaa' '\x45\x11\x74\x0a' \
3025
 
-            '\x11\x21\xee\xde' '\x0a\x00\x00\x00' \
3026
 
-            '\x03\x00\x00\x00' '\x01\x00\x00\x00' \
3027
 
-            '\x55\x5f\x67\x10' '\x03\x8c\x24\xae' \
3028
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3029
 
-            '\x3e\xd4\xba\x09' '\x4c\x85\xc3\x01' \
3030
 
-            '\x57\x25\xe6\xa8' '\x64\x50\x12\xe3'
3031
 
+        self.req_bin_0 = b'\x02\x00\x00\x12' b'\x6c\x18\x9b\xfc' \
3032
 
+            b'\x00\x00\x7f\xff' b'\x16\x12\x88\x90' \
3033
 
+            b'\x74\x6d\x9d\xaa' b'\x45\x11\x74\x0a' \
3034
 
+            b'\x11\x21\xee\xde' b'\x0a\x00\x00\x00' \
3035
 
+            b'\x03\x00\x00\x00' b'\x01\x00\x00\x00' \
3036
 
+            b'\x55\x5f\x67\x10' b'\x03\x8c\x24\xae' \
3037
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3038
 
+            b'\x3e\xd4\xba\x09' b'\x4c\x85\xc3\x01' \
3039
 
+            b'\x57\x25\xe6\xa8' b'\x64\x50\x12\xe3'
3040
 
 
3041
 
 
3042
 
     def testPackRequest0(self):
3043
 
-        bin = apply(request.ChangeWindowAttributes._request.to_binary, (), self.req_args_0)
3044
 
+        bin = request.ChangeWindowAttributes._request.to_binary(*(), **self.req_args_0)
3045
 
         try:
3046
 
             assert bin == self.req_bin_0
3047
 
         except AssertionError:
3048
 
@@ -149,7 +157,7 @@
3049
 
         self.req_args_0 = {
3050
 
             'window': 1931593850,
3051
 
             }
3052
 
-        self.req_bin_0 = '\x03\x00\x00\x02' '\x73\x21\xc8\x7a'
3053
 
+        self.req_bin_0 = b'\x03\x00\x00\x02' b'\x73\x21\xc8\x7a'
3054
 
 
3055
 
         self.reply_args_0 = {
3056
 
             'sequence_number': 60057,
3057
 
@@ -169,16 +177,16 @@
3058
 
             'do_not_propagate_mask': 33787,
3059
 
             'override_redirect': 0,
3060
 
             }
3061
 
-        self.reply_bin_0 = '\x01\x93\xea\x99' '\x00\x00\x00\x03' \
3062
 
-            '\x28\xf8\xb5\x19' '\x47\x6c\xfd\x9d' \
3063
 
-            '\x3b\x04\x67\x99' '\x08\x23\xc5\x49' \
3064
 
-            '\x00\x00\xb9\x00' '\x45\x39\x51\x8e' \
3065
 
-            '\x10\x1b\x49\x0c' '\x4f\x6a\xcc\x0f' \
3066
 
-            '\x83\xfb\x00\x00'
3067
 
+        self.reply_bin_0 = b'\x01\x93\xea\x99' b'\x00\x00\x00\x03' \
3068
 
+            b'\x28\xf8\xb5\x19' b'\x47\x6c\xfd\x9d' \
3069
 
+            b'\x3b\x04\x67\x99' b'\x08\x23\xc5\x49' \
3070
 
+            b'\x00\x00\xb9\x00' b'\x45\x39\x51\x8e' \
3071
 
+            b'\x10\x1b\x49\x0c' b'\x4f\x6a\xcc\x0f' \
3072
 
+            b'\x83\xfb\x00\x00'
3073
 
 
3074
 
 
3075
 
     def testPackRequest0(self):
3076
 
-        bin = apply(request.GetWindowAttributes._request.to_binary, (), self.req_args_0)
3077
 
+        bin = request.GetWindowAttributes._request.to_binary(*(), **self.req_args_0)
3078
 
         try:
3079
 
             assert bin == self.req_bin_0
3080
 
         except AssertionError:
3081
 
@@ -196,7 +204,7 @@
3082
 
             raise AssertionError(args)
3083
 
 
3084
 
     def testPackReply0(self):
3085
 
-        bin = apply(request.GetWindowAttributes._reply.to_binary, (), self.reply_args_0)
3086
 
+        bin = request.GetWindowAttributes._reply.to_binary(*(), **self.reply_args_0)
3087
 
         try:
3088
 
             assert bin == self.reply_bin_0
3089
 
         except AssertionError:
3090
 
@@ -219,11 +227,11 @@
3091
 
         self.req_args_0 = {
3092
 
             'window': 1622184267,
3093
 
             }
3094
 
-        self.req_bin_0 = '\x04\x00\x00\x02' '\x60\xb0\x91\x4b'
3095
 
+        self.req_bin_0 = b'\x04\x00\x00\x02' b'\x60\xb0\x91\x4b'
3096
 
 
3097
 
 
3098
 
     def testPackRequest0(self):
3099
 
-        bin = apply(request.DestroyWindow._request.to_binary, (), self.req_args_0)
3100
 
+        bin = request.DestroyWindow._request.to_binary(*(), **self.req_args_0)
3101
 
         try:
3102
 
             assert bin == self.req_bin_0
3103
 
         except AssertionError:
3104
 
@@ -246,11 +254,11 @@
3105
 
         self.req_args_0 = {
3106
 
             'window': 1000376476,
3107
 
             }
3108
 
-        self.req_bin_0 = '\x05\x00\x00\x02' '\x3b\xa0\x88\x9c'
3109
 
+        self.req_bin_0 = b'\x05\x00\x00\x02' b'\x3b\xa0\x88\x9c'
3110
 
 
3111
 
 
3112
 
     def testPackRequest0(self):
3113
 
-        bin = apply(request.DestroySubWindows._request.to_binary, (), self.req_args_0)
3114
 
+        bin = request.DestroySubWindows._request.to_binary(*(), **self.req_args_0)
3115
 
         try:
3116
 
             assert bin == self.req_bin_0
3117
 
         except AssertionError:
3118
 
@@ -274,11 +282,11 @@
3119
 
             'window': 1577523459,
3120
 
             'mode': 0,
3121
 
             }
3122
 
-        self.req_bin_0 = '\x06\x00\x00\x02' '\x5e\x07\x19\x03'
3123
 
+        self.req_bin_0 = b'\x06\x00\x00\x02' b'\x5e\x07\x19\x03'
3124
 
 
3125
 
 
3126
 
     def testPackRequest0(self):
3127
 
-        bin = apply(request.ChangeSaveSet._request.to_binary, (), self.req_args_0)
3128
 
+        bin = request.ChangeSaveSet._request.to_binary(*(), **self.req_args_0)
3129
 
         try:
3130
 
             assert bin == self.req_bin_0
3131
 
         except AssertionError:
3132
 
@@ -304,12 +312,12 @@
3133
 
             'x': -5207,
3134
 
             'y': -22675,
3135
 
             }
3136
 
-        self.req_bin_0 = '\x07\x00\x00\x04' '\x4d\x87\xa0\xa0' \
3137
 
-            '\x04\x4d\x83\x68' '\xeb\xa9\xa7\x6d'
3138
 
+        self.req_bin_0 = b'\x07\x00\x00\x04' b'\x4d\x87\xa0\xa0' \
3139
 
+            b'\x04\x4d\x83\x68' b'\xeb\xa9\xa7\x6d'
3140
 
 
3141
 
 
3142
 
     def testPackRequest0(self):
3143
 
-        bin = apply(request.ReparentWindow._request.to_binary, (), self.req_args_0)
3144
 
+        bin = request.ReparentWindow._request.to_binary(*(), **self.req_args_0)
3145
 
         try:
3146
 
             assert bin == self.req_bin_0
3147
 
         except AssertionError:
3148
 
@@ -332,11 +340,11 @@
3149
 
         self.req_args_0 = {
3150
 
             'window': 61469476,
3151
 
             }
3152
 
-        self.req_bin_0 = '\x08\x00\x00\x02' '\x03\xa9\xf3\x24'
3153
 
+        self.req_bin_0 = b'\x08\x00\x00\x02' b'\x03\xa9\xf3\x24'
3154
 
 
3155
 
 
3156
 
     def testPackRequest0(self):
3157
 
-        bin = apply(request.MapWindow._request.to_binary, (), self.req_args_0)
3158
 
+        bin = request.MapWindow._request.to_binary(*(), **self.req_args_0)
3159
 
         try:
3160
 
             assert bin == self.req_bin_0
3161
 
         except AssertionError:
3162
 
@@ -359,11 +367,11 @@
3163
 
         self.req_args_0 = {
3164
 
             'window': 818738118,
3165
 
             }
3166
 
-        self.req_bin_0 = '\x09\x00\x00\x02' '\x30\xcc\xf3\xc6'
3167
 
+        self.req_bin_0 = b'\x09\x00\x00\x02' b'\x30\xcc\xf3\xc6'
3168
 
 
3169
 
 
3170
 
     def testPackRequest0(self):
3171
 
-        bin = apply(request.MapSubwindows._request.to_binary, (), self.req_args_0)
3172
 
+        bin = request.MapSubwindows._request.to_binary(*(), **self.req_args_0)
3173
 
         try:
3174
 
             assert bin == self.req_bin_0
3175
 
         except AssertionError:
3176
 
@@ -386,11 +394,11 @@
3177
 
         self.req_args_0 = {
3178
 
             'window': 1923663468,
3179
 
             }
3180
 
-        self.req_bin_0 = '\x0a\x00\x00\x02' '\x72\xa8\xc6\x6c'
3181
 
+        self.req_bin_0 = b'\x0a\x00\x00\x02' b'\x72\xa8\xc6\x6c'
3182
 
 
3183
 
 
3184
 
     def testPackRequest0(self):
3185
 
-        bin = apply(request.UnmapWindow._request.to_binary, (), self.req_args_0)
3186
 
+        bin = request.UnmapWindow._request.to_binary(*(), **self.req_args_0)
3187
 
         try:
3188
 
             assert bin == self.req_bin_0
3189
 
         except AssertionError:
3190
 
@@ -413,11 +421,11 @@
3191
 
         self.req_args_0 = {
3192
 
             'window': 999740194,
3193
 
             }
3194
 
-        self.req_bin_0 = '\x0b\x00\x00\x02' '\x3b\x96\xd3\x22'
3195
 
+        self.req_bin_0 = b'\x0b\x00\x00\x02' b'\x3b\x96\xd3\x22'
3196
 
 
3197
 
 
3198
 
     def testPackRequest0(self):
3199
 
-        bin = apply(request.UnmapSubwindows._request.to_binary, (), self.req_args_0)
3200
 
+        bin = request.UnmapSubwindows._request.to_binary(*(), **self.req_args_0)
3201
 
         try:
3202
 
             assert bin == self.req_bin_0
3203
 
         except AssertionError:
3204
 
@@ -441,15 +449,15 @@
3205
 
             'window': 190634459,
3206
 
             'attrs': {'height': 57788, 'stack_mode': 2, 'border_width': -320, 'width': 53674, 'x': -2248, 'y': -29960, 'sibling': 1012823324},
3207
 
             }
3208
 
-        self.req_bin_0 = '\x0c\x00\x00\x0a' '\x0b\x5c\xd9\xdb' \
3209
 
-            '\x00\x7f\x00\x00' '\xf7\x38\x00\x00' \
3210
 
-            '\x8a\xf8\x00\x00' '\xd1\xaa\x00\x00' \
3211
 
-            '\xe1\xbc\x00\x00' '\xfe\xc0\x00\x00' \
3212
 
-            '\x3c\x5e\x75\x1c' '\x02\x00\x00\x00'
3213
 
+        self.req_bin_0 = b'\x0c\x00\x00\x0a' b'\x0b\x5c\xd9\xdb' \
3214
 
+            b'\x00\x7f\x00\x00' b'\xf7\x38\x00\x00' \
3215
 
+            b'\x8a\xf8\x00\x00' b'\xd1\xaa\x00\x00' \
3216
 
+            b'\xe1\xbc\x00\x00' b'\xfe\xc0\x00\x00' \
3217
 
+            b'\x3c\x5e\x75\x1c' b'\x02\x00\x00\x00'
3218
 
 
3219
 
 
3220
 
     def testPackRequest0(self):
3221
 
-        bin = apply(request.ConfigureWindow._request.to_binary, (), self.req_args_0)
3222
 
+        bin = request.ConfigureWindow._request.to_binary(*(), **self.req_args_0)
3223
 
         try:
3224
 
             assert bin == self.req_bin_0
3225
 
         except AssertionError:
3226
 
@@ -473,11 +481,11 @@
3227
 
             'window': 1712979067,
3228
 
             'direction': 1,
3229
 
             }
3230
 
-        self.req_bin_0 = '\x0d\x01\x00\x02' '\x66\x19\xfc\x7b'
3231
 
+        self.req_bin_0 = b'\x0d\x01\x00\x02' b'\x66\x19\xfc\x7b'
3232
 
 
3233
 
 
3234
 
     def testPackRequest0(self):
3235
 
-        bin = apply(request.CirculateWindow._request.to_binary, (), self.req_args_0)
3236
 
+        bin = request.CirculateWindow._request.to_binary(*(), **self.req_args_0)
3237
 
         try:
3238
 
             assert bin == self.req_bin_0
3239
 
         except AssertionError:
3240
 
@@ -500,7 +508,7 @@
3241
 
         self.req_args_0 = {
3242
 
             'drawable': 680179490,
3243
 
             }
3244
 
-        self.req_bin_0 = '\x0e\x00\x00\x02' '\x28\x8a\xb7\x22'
3245
 
+        self.req_bin_0 = b'\x0e\x00\x00\x02' b'\x28\x8a\xb7\x22'
3246
 
 
3247
 
         self.reply_args_0 = {
3248
 
             'height': 64954,
3249
 
@@ -512,14 +520,14 @@
3250
 
             'depth': 204,
3251
 
             'width': 38433,
3252
 
             }
3253
 
-        self.reply_bin_0 = '\x01\xcc\x9a\x2d' '\x00\x00\x00\x00' \
3254
 
-            '\x24\x55\x8d\x71' '\xfb\x1b\xd4\x54' \
3255
 
-            '\x96\x21\xfd\xba' '\x01\xf0\x00\x00' \
3256
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3257
 
+        self.reply_bin_0 = b'\x01\xcc\x9a\x2d' b'\x00\x00\x00\x00' \
3258
 
+            b'\x24\x55\x8d\x71' b'\xfb\x1b\xd4\x54' \
3259
 
+            b'\x96\x21\xfd\xba' b'\x01\xf0\x00\x00' \
3260
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3261
 
 
3262
 
 
3263
 
     def testPackRequest0(self):
3264
 
-        bin = apply(request.GetGeometry._request.to_binary, (), self.req_args_0)
3265
 
+        bin = request.GetGeometry._request.to_binary(*(), **self.req_args_0)
3266
 
         try:
3267
 
             assert bin == self.req_bin_0
3268
 
         except AssertionError:
3269
 
@@ -537,7 +545,7 @@
3270
 
             raise AssertionError(args)
3271
 
 
3272
 
     def testPackReply0(self):
3273
 
-        bin = apply(request.GetGeometry._reply.to_binary, (), self.reply_args_0)
3274
 
+        bin = request.GetGeometry._reply.to_binary(*(), **self.reply_args_0)
3275
 
         try:
3276
 
             assert bin == self.reply_bin_0
3277
 
         except AssertionError:
3278
 
@@ -560,7 +568,7 @@
3279
 
         self.req_args_0 = {
3280
 
             'window': 2052496265,
3281
 
             }
3282
 
-        self.req_bin_0 = '\x0f\x00\x00\x02' '\x7a\x56\x9b\x89'
3283
 
+        self.req_bin_0 = b'\x0f\x00\x00\x02' b'\x7a\x56\x9b\x89'
3284
 
 
3285
 
         self.reply_args_0 = {
3286
 
             'sequence_number': 33887,
3287
 
@@ -568,18 +576,18 @@
3288
 
             'root': 1856577120,
3289
 
             'parent': 2105827407,
3290
 
             }
3291
 
-        self.reply_bin_0 = '\x01\x00\x84\x5f' '\x00\x00\x00\x07' \
3292
 
-            '\x6e\xa9\x1e\x60' '\x7d\x84\x60\x4f' \
3293
 
-            '\x00\x07\x00\x00' '\x00\x00\x00\x00' \
3294
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3295
 
-            '\x6b\x09\x3d\x72' '\x59\x14\x21\xa5' \
3296
 
-            '\x2c\x9a\x2c\x42' '\x2b\x7b\x78\xa1' \
3297
 
-            '\x4b\x39\x79\x79' '\x03\xd4\x32\x73' \
3298
 
-            '\x40\xdd\x8e\x53'
3299
 
+        self.reply_bin_0 = b'\x01\x00\x84\x5f' b'\x00\x00\x00\x07' \
3300
 
+            b'\x6e\xa9\x1e\x60' b'\x7d\x84\x60\x4f' \
3301
 
+            b'\x00\x07\x00\x00' b'\x00\x00\x00\x00' \
3302
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3303
 
+            b'\x6b\x09\x3d\x72' b'\x59\x14\x21\xa5' \
3304
 
+            b'\x2c\x9a\x2c\x42' b'\x2b\x7b\x78\xa1' \
3305
 
+            b'\x4b\x39\x79\x79' b'\x03\xd4\x32\x73' \
3306
 
+            b'\x40\xdd\x8e\x53'
3307
 
 
3308
 
 
3309
 
     def testPackRequest0(self):
3310
 
-        bin = apply(request.QueryTree._request.to_binary, (), self.req_args_0)
3311
 
+        bin = request.QueryTree._request.to_binary(*(), **self.req_args_0)
3312
 
         try:
3313
 
             assert bin == self.req_bin_0
3314
 
         except AssertionError:
3315
 
@@ -597,7 +605,7 @@
3316
 
             raise AssertionError(args)
3317
 
 
3318
 
     def testPackReply0(self):
3319
 
-        bin = apply(request.QueryTree._reply.to_binary, (), self.reply_args_0)
3320
 
+        bin = request.QueryTree._reply.to_binary(*(), **self.reply_args_0)
3321
 
         try:
3322
 
             assert bin == self.reply_bin_0
3323
 
         except AssertionError:
3324
 
@@ -621,22 +629,22 @@
3325
 
             'only_if_exists': 0,
3326
 
             'name': 'fuzzy_prop',
3327
 
             }
3328
 
-        self.req_bin_0 = '\x10\x00\x00\x05' '\x00\x0a\x00\x00' \
3329
 
-            '\x66\x75\x7a\x7a' '\x79\x5f\x70\x72' \
3330
 
-            '\x6f\x70\x00\x00'
3331
 
+        self.req_bin_0 = b'\x10\x00\x00\x05' b'\x00\x0a\x00\x00' \
3332
 
+            b'\x66\x75\x7a\x7a' b'\x79\x5f\x70\x72' \
3333
 
+            b'\x6f\x70\x00\x00'
3334
 
 
3335
 
         self.reply_args_0 = {
3336
 
             'atom': 48723297,
3337
 
             'sequence_number': 35223,
3338
 
             }
3339
 
-        self.reply_bin_0 = '\x01\x00\x89\x97' '\x00\x00\x00\x00' \
3340
 
-            '\x02\xe7\x75\x61' '\x00\x00\x00\x00' \
3341
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3342
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3343
 
+        self.reply_bin_0 = b'\x01\x00\x89\x97' b'\x00\x00\x00\x00' \
3344
 
+            b'\x02\xe7\x75\x61' b'\x00\x00\x00\x00' \
3345
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3346
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3347
 
 
3348
 
 
3349
 
     def testPackRequest0(self):
3350
 
-        bin = apply(request.InternAtom._request.to_binary, (), self.req_args_0)
3351
 
+        bin = request.InternAtom._request.to_binary(*(), **self.req_args_0)
3352
 
         try:
3353
 
             assert bin == self.req_bin_0
3354
 
         except AssertionError:
3355
 
@@ -654,7 +662,7 @@
3356
 
             raise AssertionError(args)
3357
 
 
3358
 
     def testPackReply0(self):
3359
 
-        bin = apply(request.InternAtom._reply.to_binary, (), self.reply_args_0)
3360
 
+        bin = request.InternAtom._reply.to_binary(*(), **self.reply_args_0)
3361
 
         try:
3362
 
             assert bin == self.reply_bin_0
3363
 
         except AssertionError:
3364
 
@@ -677,21 +685,21 @@
3365
 
         self.req_args_0 = {
3366
 
             'atom': 1022286544,
3367
 
             }
3368
 
-        self.req_bin_0 = '\x11\x00\x00\x02' '\x3c\xee\xda\xd0'
3369
 
+        self.req_bin_0 = b'\x11\x00\x00\x02' b'\x3c\xee\xda\xd0'
3370
 
 
3371
 
         self.reply_args_0 = {
3372
 
             'sequence_number': 22699,
3373
 
             'name': 'WM_CLASS',
3374
 
             }
3375
 
-        self.reply_bin_0 = '\x01\x00\x58\xab' '\x00\x00\x00\x02' \
3376
 
-            '\x00\x08\x00\x00' '\x00\x00\x00\x00' \
3377
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3378
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3379
 
-            '\x57\x4d\x5f\x43' '\x4c\x41\x53\x53'
3380
 
+        self.reply_bin_0 = b'\x01\x00\x58\xab' b'\x00\x00\x00\x02' \
3381
 
+            b'\x00\x08\x00\x00' b'\x00\x00\x00\x00' \
3382
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3383
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3384
 
+            b'\x57\x4d\x5f\x43' b'\x4c\x41\x53\x53'
3385
 
 
3386
 
 
3387
 
     def testPackRequest0(self):
3388
 
-        bin = apply(request.GetAtomName._request.to_binary, (), self.req_args_0)
3389
 
+        bin = request.GetAtomName._request.to_binary(*(), **self.req_args_0)
3390
 
         try:
3391
 
             assert bin == self.req_bin_0
3392
 
         except AssertionError:
3393
 
@@ -709,7 +717,7 @@
3394
 
             raise AssertionError(args)
3395
 
 
3396
 
     def testPackReply0(self):
3397
 
-        bin = apply(request.GetAtomName._reply.to_binary, (), self.reply_args_0)
3398
 
+        bin = request.GetAtomName._reply.to_binary(*(), **self.reply_args_0)
3399
 
         try:
3400
 
             assert bin == self.reply_bin_0
3401
 
         except AssertionError:
3402
 
@@ -736,9 +744,9 @@
3403
 
             'window': 266197951,
3404
 
             'type': 1343008022,
3405
 
             }
3406
 
-        self.req_bin_0 = '\x12\x00\x00\x06' '\x0f\xdd\xdb\xbf' \
3407
 
-            '\x7c\x4c\x97\x11' '\x50\x0c\xad\x16' \
3408
 
-            '\x08\x00\x00\x00' '\x00\x00\x00\x00'
3409
 
+        self.req_bin_0 = b'\x12\x00\x00\x06' b'\x0f\xdd\xdb\xbf' \
3410
 
+            b'\x7c\x4c\x97\x11' b'\x50\x0c\xad\x16' \
3411
 
+            b'\x08\x00\x00\x00' b'\x00\x00\x00\x00'
3412
 
 
3413
 
         self.req_args_1 = {
3414
 
             'mode': 2,
3415
 
@@ -747,10 +755,10 @@
3416
 
             'window': 1522118044,
3417
 
             'type': 121096013,
3418
 
             }
3419
 
-        self.req_bin_1 = '\x12\x02\x00\x07' '\x5a\xb9\xad\x9c' \
3420
 
-            '\x1a\xce\x2e\xab' '\x07\x37\xc7\x4d' \
3421
 
-            '\x08\x00\x00\x00' '\x00\x00\x00\x03' \
3422
 
-            '\x66\x6f\x6f\x00'
3423
 
+        self.req_bin_1 = b'\x12\x02\x00\x07' b'\x5a\xb9\xad\x9c' \
3424
 
+            b'\x1a\xce\x2e\xab' b'\x07\x37\xc7\x4d' \
3425
 
+            b'\x08\x00\x00\x00' b'\x00\x00\x00\x03' \
3426
 
+            b'\x66\x6f\x6f\x00'
3427
 
 
3428
 
         self.req_args_2 = {
3429
 
             'mode': 2,
3430
 
@@ -759,10 +767,10 @@
3431
 
             'window': 286324270,
3432
 
             'type': 1547457396,
3433
 
             }
3434
 
-        self.req_bin_2 = '\x12\x02\x00\x07' '\x11\x10\xf6\x2e' \
3435
 
-            '\x3c\x30\xf5\x5a' '\x5c\x3c\x53\x74' \
3436
 
-            '\x08\x00\x00\x00' '\x00\x00\x00\x04' \
3437
 
-            '\x7a\x6f\x6f\x6d'
3438
 
+        self.req_bin_2 = b'\x12\x02\x00\x07' b'\x11\x10\xf6\x2e' \
3439
 
+            b'\x3c\x30\xf5\x5a' b'\x5c\x3c\x53\x74' \
3440
 
+            b'\x08\x00\x00\x00' b'\x00\x00\x00\x04' \
3441
 
+            b'\x7a\x6f\x6f\x6d'
3442
 
 
3443
 
         self.req_args_3 = {
3444
 
             'mode': 0,
3445
 
@@ -771,9 +779,9 @@
3446
 
             'window': 1964921608,
3447
 
             'type': 692879036,
3448
 
             }
3449
 
-        self.req_bin_3 = '\x12\x00\x00\x06' '\x75\x1e\x53\x08' \
3450
 
-            '\x19\x73\x3e\xc0' '\x29\x4c\x7e\xbc' \
3451
 
-            '\x10\x00\x00\x00' '\x00\x00\x00\x00'
3452
 
+        self.req_bin_3 = b'\x12\x00\x00\x06' b'\x75\x1e\x53\x08' \
3453
 
+            b'\x19\x73\x3e\xc0' b'\x29\x4c\x7e\xbc' \
3454
 
+            b'\x10\x00\x00\x00' b'\x00\x00\x00\x00'
3455
 
 
3456
 
         self.req_args_4 = {
3457
 
             'mode': 0,
3458
 
@@ -782,10 +790,10 @@
3459
 
             'window': 560040176,
3460
 
             'type': 2030208993,
3461
 
             }
3462
 
-        self.req_bin_4 = '\x12\x00\x00\x08' '\x21\x61\x88\xf0' \
3463
 
-            '\x2f\xbe\x64\xa4' '\x79\x02\x87\xe1' \
3464
 
-            '\x10\x00\x00\x00' '\x00\x00\x00\x03' \
3465
 
-            '\x00\x01\x00\x02' '\x00\x03\x00\x00'
3466
 
+        self.req_bin_4 = b'\x12\x00\x00\x08' b'\x21\x61\x88\xf0' \
3467
 
+            b'\x2f\xbe\x64\xa4' b'\x79\x02\x87\xe1' \
3468
 
+            b'\x10\x00\x00\x00' b'\x00\x00\x00\x03' \
3469
 
+            b'\x00\x01\x00\x02' b'\x00\x03\x00\x00'
3470
 
 
3471
 
         self.req_args_5 = {
3472
 
             'mode': 0,
3473
 
@@ -794,10 +802,10 @@
3474
 
             'window': 2016421454,
3475
 
             'type': 434059096,
3476
 
             }
3477
 
-        self.req_bin_5 = '\x12\x00\x00\x08' '\x78\x30\x26\x4e' \
3478
 
-            '\x53\x8c\x0f\x22' '\x19\xdf\x37\x58' \
3479
 
-            '\x10\x00\x00\x00' '\x00\x00\x00\x04' \
3480
 
-            '\x00\x01\x00\x02' '\x00\x03\x00\x04'
3481
 
+        self.req_bin_5 = b'\x12\x00\x00\x08' b'\x78\x30\x26\x4e' \
3482
 
+            b'\x53\x8c\x0f\x22' b'\x19\xdf\x37\x58' \
3483
 
+            b'\x10\x00\x00\x00' b'\x00\x00\x00\x04' \
3484
 
+            b'\x00\x01\x00\x02' b'\x00\x03\x00\x04'
3485
 
 
3486
 
         self.req_args_6 = {
3487
 
             'mode': 2,
3488
 
@@ -806,9 +814,9 @@
3489
 
             'window': 461926013,
3490
 
             'type': 613217208,
3491
 
             }
3492
 
-        self.req_bin_6 = '\x12\x02\x00\x06' '\x1b\x88\x6e\x7d' \
3493
 
-            '\x3c\x23\x1c\xbb' '\x24\x8c\xf3\xb8' \
3494
 
-            '\x20\x00\x00\x00' '\x00\x00\x00\x00'
3495
 
+        self.req_bin_6 = b'\x12\x02\x00\x06' b'\x1b\x88\x6e\x7d' \
3496
 
+            b'\x3c\x23\x1c\xbb' b'\x24\x8c\xf3\xb8' \
3497
 
+            b'\x20\x00\x00\x00' b'\x00\x00\x00\x00'
3498
 
 
3499
 
         self.req_args_7 = {
3500
 
             'mode': 1,
3501
 
@@ -817,15 +825,15 @@
3502
 
             'window': 367636986,
3503
 
             'type': 1085552939,
3504
 
             }
3505
 
-        self.req_bin_7 = '\x12\x01\x00\x09' '\x15\xe9\xb1\xfa' \
3506
 
-            '\x57\xc4\x9f\x58' '\x40\xb4\x39\x2b' \
3507
 
-            '\x20\x00\x00\x00' '\x00\x00\x00\x03' \
3508
 
-            '\x00\x00\x00\x01' '\x00\x00\x00\x02' \
3509
 
-            '\x00\x00\x00\x03'
3510
 
+        self.req_bin_7 = b'\x12\x01\x00\x09' b'\x15\xe9\xb1\xfa' \
3511
 
+            b'\x57\xc4\x9f\x58' b'\x40\xb4\x39\x2b' \
3512
 
+            b'\x20\x00\x00\x00' b'\x00\x00\x00\x03' \
3513
 
+            b'\x00\x00\x00\x01' b'\x00\x00\x00\x02' \
3514
 
+            b'\x00\x00\x00\x03'
3515
 
 
3516
 
 
3517
 
     def testPackRequest0(self):
3518
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_0)
3519
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_0)
3520
 
         try:
3521
 
             assert bin == self.req_bin_0
3522
 
         except AssertionError:
3523
 
@@ -843,7 +851,7 @@
3524
 
             raise AssertionError(args)
3525
 
 
3526
 
     def testPackRequest1(self):
3527
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_1)
3528
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_1)
3529
 
         try:
3530
 
             assert bin == self.req_bin_1
3531
 
         except AssertionError:
3532
 
@@ -861,7 +869,7 @@
3533
 
             raise AssertionError(args)
3534
 
 
3535
 
     def testPackRequest2(self):
3536
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_2)
3537
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_2)
3538
 
         try:
3539
 
             assert bin == self.req_bin_2
3540
 
         except AssertionError:
3541
 
@@ -879,7 +887,7 @@
3542
 
             raise AssertionError(args)
3543
 
 
3544
 
     def testPackRequest3(self):
3545
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_3)
3546
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_3)
3547
 
         try:
3548
 
             assert bin == self.req_bin_3
3549
 
         except AssertionError:
3550
 
@@ -897,7 +905,7 @@
3551
 
             raise AssertionError(args)
3552
 
 
3553
 
     def testPackRequest4(self):
3554
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_4)
3555
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_4)
3556
 
         try:
3557
 
             assert bin == self.req_bin_4
3558
 
         except AssertionError:
3559
 
@@ -915,7 +923,7 @@
3560
 
             raise AssertionError(args)
3561
 
 
3562
 
     def testPackRequest5(self):
3563
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_5)
3564
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_5)
3565
 
         try:
3566
 
             assert bin == self.req_bin_5
3567
 
         except AssertionError:
3568
 
@@ -933,7 +941,7 @@
3569
 
             raise AssertionError(args)
3570
 
 
3571
 
     def testPackRequest6(self):
3572
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_6)
3573
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_6)
3574
 
         try:
3575
 
             assert bin == self.req_bin_6
3576
 
         except AssertionError:
3577
 
@@ -951,7 +959,7 @@
3578
 
             raise AssertionError(args)
3579
 
 
3580
 
     def testPackRequest7(self):
3581
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_7)
3582
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_7)
3583
 
         try:
3584
 
             assert bin == self.req_bin_7
3585
 
         except AssertionError:
3586
 
@@ -975,12 +983,12 @@
3587
 
             'property': 506897017,
3588
 
             'window': 381870530,
3589
 
             }
3590
 
-        self.req_bin_0 = '\x13\x00\x00\x03' '\x16\xc2\xe1\xc2' \
3591
 
-            '\x1e\x36\xa2\x79'
3592
 
+        self.req_bin_0 = b'\x13\x00\x00\x03' b'\x16\xc2\xe1\xc2' \
3593
 
+            b'\x1e\x36\xa2\x79'
3594
 
 
3595
 
 
3596
 
     def testPackRequest0(self):
3597
 
-        bin = apply(request.DeleteProperty._request.to_binary, (), self.req_args_0)
3598
 
+        bin = request.DeleteProperty._request.to_binary(*(), **self.req_args_0)
3599
 
         try:
3600
 
             assert bin == self.req_bin_0
3601
 
         except AssertionError:
3602
 
@@ -1008,9 +1016,9 @@
3603
 
             'window': 1477792536,
3604
 
             'long_length': 1346507413,
3605
 
             }
3606
 
-        self.req_bin_0 = '\x14\x00\x00\x06' '\x58\x15\x53\x18' \
3607
 
-            '\x3c\x11\x6b\x13' '\x5c\xc5\x9b\xa0' \
3608
 
-            '\x5d\x30\x8c\xce' '\x50\x42\x12\x95'
3609
 
+        self.req_bin_0 = b'\x14\x00\x00\x06' b'\x58\x15\x53\x18' \
3610
 
+            b'\x3c\x11\x6b\x13' b'\x5c\xc5\x9b\xa0' \
3611
 
+            b'\x5d\x30\x8c\xce' b'\x50\x42\x12\x95'
3612
 
 
3613
 
         self.reply_args_0 = {
3614
 
             'value': (8, ''),
3615
 
@@ -1018,10 +1026,10 @@
3616
 
             'property_type': 1392423916,
3617
 
             'bytes_after': 2046056935,
3618
 
             }
3619
 
-        self.reply_bin_0 = '\x01\x08\x77\x8e' '\x00\x00\x00\x00' \
3620
 
-            '\x52\xfe\xb3\xec' '\x79\xf4\x59\xe7' \
3621
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3622
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3623
 
+        self.reply_bin_0 = b'\x01\x08\x77\x8e' b'\x00\x00\x00\x00' \
3624
 
+            b'\x52\xfe\xb3\xec' b'\x79\xf4\x59\xe7' \
3625
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3626
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3627
 
 
3628
 
         self.reply_args_1 = {
3629
 
             'value': (8, 'foo'),
3630
 
@@ -1029,11 +1037,11 @@
3631
 
             'property_type': 186441230,
3632
 
             'bytes_after': 469299413,
3633
 
             }
3634
 
-        self.reply_bin_1 = '\x01\x08\xac\xf7' '\x00\x00\x00\x01' \
3635
 
-            '\x0b\x1c\xde\x0e' '\x1b\xf8\xf0\xd5' \
3636
 
-            '\x00\x00\x00\x03' '\x00\x00\x00\x00' \
3637
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3638
 
-            '\x66\x6f\x6f\x00'
3639
 
+        self.reply_bin_1 = b'\x01\x08\xac\xf7' b'\x00\x00\x00\x01' \
3640
 
+            b'\x0b\x1c\xde\x0e' b'\x1b\xf8\xf0\xd5' \
3641
 
+            b'\x00\x00\x00\x03' b'\x00\x00\x00\x00' \
3642
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3643
 
+            b'\x66\x6f\x6f\x00'
3644
 
 
3645
 
         self.reply_args_2 = {
3646
 
             'value': (8, 'zoom'),
3647
 
@@ -1041,11 +1049,11 @@
3648
 
             'property_type': 1802804296,
3649
 
             'bytes_after': 1968158856,
3650
 
             }
3651
 
-        self.reply_bin_2 = '\x01\x08\x31\x82' '\x00\x00\x00\x01' \
3652
 
-            '\x6b\x74\x9c\x48' '\x75\x4f\xb8\x88' \
3653
 
-            '\x00\x00\x00\x04' '\x00\x00\x00\x00' \
3654
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3655
 
-            '\x7a\x6f\x6f\x6d'
3656
 
+        self.reply_bin_2 = b'\x01\x08\x31\x82' b'\x00\x00\x00\x01' \
3657
 
+            b'\x6b\x74\x9c\x48' b'\x75\x4f\xb8\x88' \
3658
 
+            b'\x00\x00\x00\x04' b'\x00\x00\x00\x00' \
3659
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3660
 
+            b'\x7a\x6f\x6f\x6d'
3661
 
 
3662
 
         self.reply_args_3 = {
3663
 
             'value': (16, []),
3664
 
@@ -1053,10 +1061,10 @@
3665
 
             'property_type': 536196393,
3666
 
             'bytes_after': 1874157309,
3667
 
             }
3668
 
-        self.reply_bin_3 = '\x01\x10\x62\xdf' '\x00\x00\x00\x00' \
3669
 
-            '\x1f\xf5\xb5\x29' '\x6f\xb5\x5e\xfd' \
3670
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3671
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3672
 
+        self.reply_bin_3 = b'\x01\x10\x62\xdf' b'\x00\x00\x00\x00' \
3673
 
+            b'\x1f\xf5\xb5\x29' b'\x6f\xb5\x5e\xfd' \
3674
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3675
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3676
 
 
3677
 
         self.reply_args_4 = {
3678
 
             'value': (16, [1, 2, 3]),
3679
 
@@ -1064,11 +1072,11 @@
3680
 
             'property_type': 1046879880,
3681
 
             'bytes_after': 1952710167,
3682
 
             }
3683
 
-        self.reply_bin_4 = '\x01\x10\x58\x89' '\x00\x00\x00\x02' \
3684
 
-            '\x3e\x66\x1e\x88' '\x74\x63\xfe\x17' \
3685
 
-            '\x00\x00\x00\x03' '\x00\x00\x00\x00' \
3686
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3687
 
-            '\x00\x01\x00\x02' '\x00\x03\x00\x00'
3688
 
+        self.reply_bin_4 = b'\x01\x10\x58\x89' b'\x00\x00\x00\x02' \
3689
 
+            b'\x3e\x66\x1e\x88' b'\x74\x63\xfe\x17' \
3690
 
+            b'\x00\x00\x00\x03' b'\x00\x00\x00\x00' \
3691
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3692
 
+            b'\x00\x01\x00\x02' b'\x00\x03\x00\x00'
3693
 
 
3694
 
         self.reply_args_5 = {
3695
 
             'value': (16, [1, 2, 3, 4]),
3696
 
@@ -1076,11 +1084,11 @@
3697
 
             'property_type': 1014173132,
3698
 
             'bytes_after': 1791090668,
3699
 
             }
3700
 
-        self.reply_bin_5 = '\x01\x10\x4a\x54' '\x00\x00\x00\x02' \
3701
 
-            '\x3c\x73\x0d\xcc' '\x6a\xc1\xdf\xec' \
3702
 
-            '\x00\x00\x00\x04' '\x00\x00\x00\x00' \
3703
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3704
 
-            '\x00\x01\x00\x02' '\x00\x03\x00\x04'
3705
 
+        self.reply_bin_5 = b'\x01\x10\x4a\x54' b'\x00\x00\x00\x02' \
3706
 
+            b'\x3c\x73\x0d\xcc' b'\x6a\xc1\xdf\xec' \
3707
 
+            b'\x00\x00\x00\x04' b'\x00\x00\x00\x00' \
3708
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3709
 
+            b'\x00\x01\x00\x02' b'\x00\x03\x00\x04'
3710
 
 
3711
 
         self.reply_args_6 = {
3712
 
             'value': (32, []),
3713
 
@@ -1088,10 +1096,10 @@
3714
 
             'property_type': 2053870497,
3715
 
             'bytes_after': 1727548898,
3716
 
             }
3717
 
-        self.reply_bin_6 = '\x01\x20\xb8\x7a' '\x00\x00\x00\x00' \
3718
 
-            '\x7a\x6b\x93\xa1' '\x66\xf8\x4d\xe2' \
3719
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3720
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3721
 
+        self.reply_bin_6 = b'\x01\x20\xb8\x7a' b'\x00\x00\x00\x00' \
3722
 
+            b'\x7a\x6b\x93\xa1' b'\x66\xf8\x4d\xe2' \
3723
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3724
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3725
 
 
3726
 
         self.reply_args_7 = {
3727
 
             'value': (32, [1, 2, 3]),
3728
 
@@ -1099,16 +1107,16 @@
3729
 
             'property_type': 704363625,
3730
 
             'bytes_after': 1957409055,
3731
 
             }
3732
 
-        self.reply_bin_7 = '\x01\x20\x90\xe6' '\x00\x00\x00\x03' \
3733
 
-            '\x29\xfb\xbc\x69' '\x74\xab\xb1\x1f' \
3734
 
-            '\x00\x00\x00\x03' '\x00\x00\x00\x00' \
3735
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3736
 
-            '\x00\x00\x00\x01' '\x00\x00\x00\x02' \
3737
 
-            '\x00\x00\x00\x03'
3738
 
+        self.reply_bin_7 = b'\x01\x20\x90\xe6' b'\x00\x00\x00\x03' \
3739
 
+            b'\x29\xfb\xbc\x69' b'\x74\xab\xb1\x1f' \
3740
 
+            b'\x00\x00\x00\x03' b'\x00\x00\x00\x00' \
3741
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3742
 
+            b'\x00\x00\x00\x01' b'\x00\x00\x00\x02' \
3743
 
+            b'\x00\x00\x00\x03'
3744
 
 
3745
 
 
3746
 
     def testPackRequest0(self):
3747
 
-        bin = apply(request.GetProperty._request.to_binary, (), self.req_args_0)
3748
 
+        bin = request.GetProperty._request.to_binary(*(), **self.req_args_0)
3749
 
         try:
3750
 
             assert bin == self.req_bin_0
3751
 
         except AssertionError:
3752
 
@@ -1126,7 +1134,7 @@
3753
 
             raise AssertionError(args)
3754
 
 
3755
 
     def testPackReply0(self):
3756
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_0)
3757
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_0)
3758
 
         try:
3759
 
             assert bin == self.reply_bin_0
3760
 
         except AssertionError:
3761
 
@@ -1144,7 +1152,7 @@
3762
 
             raise AssertionError(args)
3763
 
 
3764
 
     def testPackReply1(self):
3765
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_1)
3766
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_1)
3767
 
         try:
3768
 
             assert bin == self.reply_bin_1
3769
 
         except AssertionError:
3770
 
@@ -1162,7 +1170,7 @@
3771
 
             raise AssertionError(args)
3772
 
 
3773
 
     def testPackReply2(self):
3774
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_2)
3775
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_2)
3776
 
         try:
3777
 
             assert bin == self.reply_bin_2
3778
 
         except AssertionError:
3779
 
@@ -1180,7 +1188,7 @@
3780
 
             raise AssertionError(args)
3781
 
 
3782
 
     def testPackReply3(self):
3783
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_3)
3784
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_3)
3785
 
         try:
3786
 
             assert bin == self.reply_bin_3
3787
 
         except AssertionError:
3788
 
@@ -1198,7 +1206,7 @@
3789
 
             raise AssertionError(args)
3790
 
 
3791
 
     def testPackReply4(self):
3792
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_4)
3793
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_4)
3794
 
         try:
3795
 
             assert bin == self.reply_bin_4
3796
 
         except AssertionError:
3797
 
@@ -1216,7 +1224,7 @@
3798
 
             raise AssertionError(args)
3799
 
 
3800
 
     def testPackReply5(self):
3801
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_5)
3802
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_5)
3803
 
         try:
3804
 
             assert bin == self.reply_bin_5
3805
 
         except AssertionError:
3806
 
@@ -1234,7 +1242,7 @@
3807
 
             raise AssertionError(args)
3808
 
 
3809
 
     def testPackReply6(self):
3810
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_6)
3811
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_6)
3812
 
         try:
3813
 
             assert bin == self.reply_bin_6
3814
 
         except AssertionError:
3815
 
@@ -1252,7 +1260,7 @@
3816
 
             raise AssertionError(args)
3817
 
 
3818
 
     def testPackReply7(self):
3819
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_7)
3820
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_7)
3821
 
         try:
3822
 
             assert bin == self.reply_bin_7
3823
 
         except AssertionError:
3824
 
@@ -1275,32 +1283,32 @@
3825
 
         self.req_args_0 = {
3826
 
             'window': 91262675,
3827
 
             }
3828
 
-        self.req_bin_0 = '\x15\x00\x00\x02' '\x05\x70\x8e\xd3'
3829
 
+        self.req_bin_0 = b'\x15\x00\x00\x02' b'\x05\x70\x8e\xd3'
3830
 
 
3831
 
         self.reply_args_0 = {
3832
 
             'atoms': [580972634, 926488735, 714741529, 408777797, 679906858, 705092899, 2063243279, 893967755, 1591182471, 571137996, 1677110101, 1783836762, 1678219148, 1992402577, 871298793, 1182885899, 1155013854, 1822076326, 2117552706, 1972668469, 1660227078, 1523268962, 694042433],
3833
 
             'sequence_number': 42191,
3834
 
             }
3835
 
-        self.reply_bin_0 = '\x01\x00\xa4\xcf' '\x00\x00\x00\x17' \
3836
 
-            '\x00\x17\x00\x00' '\x00\x00\x00\x00' \
3837
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3838
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3839
 
-            '\x22\xa0\xf0\x5a' '\x37\x39\x18\x9f' \
3840
 
-            '\x2a\x9a\x17\x19' '\x18\x5d\x74\x45' \
3841
 
-            '\x28\x86\x8e\x2a' '\x2a\x06\xdd\x23' \
3842
 
-            '\x7a\xfa\x98\x0f' '\x35\x48\xdd\x8b' \
3843
 
-            '\x5e\xd7\x84\x87' '\x22\x0a\xdf\xcc' \
3844
 
-            '\x63\xf6\xab\x55' '\x6a\x53\x30\x5a' \
3845
 
-            '\x64\x07\x97\x8c' '\x76\xc1\xa6\x91' \
3846
 
-            '\x33\xee\xf6\xe9' '\x46\x81\x68\x0b' \
3847
 
-            '\x44\xd8\x1c\xde' '\x6c\x9a\xad\xa6' \
3848
 
-            '\x7e\x37\x4a\x42' '\x75\x94\x88\x35' \
3849
 
-            '\x62\xf5\x0e\x06' '\x5a\xcb\x3d\x62' \
3850
 
-            '\x29\x5e\x3f\x41'
3851
 
+        self.reply_bin_0 = b'\x01\x00\xa4\xcf' b'\x00\x00\x00\x17' \
3852
 
+            b'\x00\x17\x00\x00' b'\x00\x00\x00\x00' \
3853
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3854
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3855
 
+            b'\x22\xa0\xf0\x5a' b'\x37\x39\x18\x9f' \
3856
 
+            b'\x2a\x9a\x17\x19' b'\x18\x5d\x74\x45' \
3857
 
+            b'\x28\x86\x8e\x2a' b'\x2a\x06\xdd\x23' \
3858
 
+            b'\x7a\xfa\x98\x0f' b'\x35\x48\xdd\x8b' \
3859
 
+            b'\x5e\xd7\x84\x87' b'\x22\x0a\xdf\xcc' \
3860
 
+            b'\x63\xf6\xab\x55' b'\x6a\x53\x30\x5a' \
3861
 
+            b'\x64\x07\x97\x8c' b'\x76\xc1\xa6\x91' \
3862
 
+            b'\x33\xee\xf6\xe9' b'\x46\x81\x68\x0b' \
3863
 
+            b'\x44\xd8\x1c\xde' b'\x6c\x9a\xad\xa6' \
3864
 
+            b'\x7e\x37\x4a\x42' b'\x75\x94\x88\x35' \
3865
 
+            b'\x62\xf5\x0e\x06' b'\x5a\xcb\x3d\x62' \
3866
 
+            b'\x29\x5e\x3f\x41'
3867
 
 
3868
 
 
3869
 
     def testPackRequest0(self):
3870
 
-        bin = apply(request.ListProperties._request.to_binary, (), self.req_args_0)
3871
 
+        bin = request.ListProperties._request.to_binary(*(), **self.req_args_0)
3872
 
         try:
3873
 
             assert bin == self.req_bin_0
3874
 
         except AssertionError:
3875
 
@@ -1318,7 +1326,7 @@
3876
 
             raise AssertionError(args)
3877
 
 
3878
 
     def testPackReply0(self):
3879
 
-        bin = apply(request.ListProperties._reply.to_binary, (), self.reply_args_0)
3880
 
+        bin = request.ListProperties._reply.to_binary(*(), **self.reply_args_0)
3881
 
         try:
3882
 
             assert bin == self.reply_bin_0
3883
 
         except AssertionError:
3884
 
@@ -1343,12 +1351,12 @@
3885
 
             'window': 1190911777,
3886
 
             'time': 1606660593,
3887
 
             }
3888
 
-        self.req_bin_0 = '\x16\x00\x00\x04' '\x46\xfb\xdf\x21' \
3889
 
-            '\x7b\x74\xe4\x1b' '\x5f\xc3\xb1\xf1'
3890
 
+        self.req_bin_0 = b'\x16\x00\x00\x04' b'\x46\xfb\xdf\x21' \
3891
 
+            b'\x7b\x74\xe4\x1b' b'\x5f\xc3\xb1\xf1'
3892
 
 
3893
 
 
3894
 
     def testPackRequest0(self):
3895
 
-        bin = apply(request.SetSelectionOwner._request.to_binary, (), self.req_args_0)
3896
 
+        bin = request.SetSelectionOwner._request.to_binary(*(), **self.req_args_0)
3897
 
         try:
3898
 
             assert bin == self.req_bin_0
3899
 
         except AssertionError:
3900
 
@@ -1371,20 +1379,20 @@
3901
 
         self.req_args_0 = {
3902
 
             'selection': 819576555,
3903
 
             }
3904
 
-        self.req_bin_0 = '\x17\x00\x00\x02' '\x30\xd9\xbe\xeb'
3905
 
+        self.req_bin_0 = b'\x17\x00\x00\x02' b'\x30\xd9\xbe\xeb'
3906
 
 
3907
 
         self.reply_args_0 = {
3908
 
             'sequence_number': 14152,
3909
 
             'owner': 1922331178,
3910
 
             }
3911
 
-        self.reply_bin_0 = '\x01\x00\x37\x48' '\x00\x00\x00\x00' \
3912
 
-            '\x72\x94\x72\x2a' '\x00\x00\x00\x00' \
3913
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3914
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3915
 
+        self.reply_bin_0 = b'\x01\x00\x37\x48' b'\x00\x00\x00\x00' \
3916
 
+            b'\x72\x94\x72\x2a' b'\x00\x00\x00\x00' \
3917
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3918
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
3919
 
 
3920
 
 
3921
 
     def testPackRequest0(self):
3922
 
-        bin = apply(request.GetSelectionOwner._request.to_binary, (), self.req_args_0)
3923
 
+        bin = request.GetSelectionOwner._request.to_binary(*(), **self.req_args_0)
3924
 
         try:
3925
 
             assert bin == self.req_bin_0
3926
 
         except AssertionError:
3927
 
@@ -1402,7 +1410,7 @@
3928
 
             raise AssertionError(args)
3929
 
 
3930
 
     def testPackReply0(self):
3931
 
-        bin = apply(request.GetSelectionOwner._reply.to_binary, (), self.reply_args_0)
3932
 
+        bin = request.GetSelectionOwner._reply.to_binary(*(), **self.reply_args_0)
3933
 
         try:
3934
 
             assert bin == self.reply_bin_0
3935
 
         except AssertionError:
3936
 
@@ -1429,13 +1437,13 @@
3937
 
             'selection': 125139929,
3938
 
             'requestor': 300355135,
3939
 
             }
3940
 
-        self.req_bin_0 = '\x18\x00\x00\x06' '\x11\xe7\x0e\x3f' \
3941
 
-            '\x07\x75\x7b\xd9' '\x75\x8e\x82\x08' \
3942
 
-            '\x7f\x6c\x1d\xb7' '\x5f\x0c\x79\xd6'
3943
 
+        self.req_bin_0 = b'\x18\x00\x00\x06' b'\x11\xe7\x0e\x3f' \
3944
 
+            b'\x07\x75\x7b\xd9' b'\x75\x8e\x82\x08' \
3945
 
+            b'\x7f\x6c\x1d\xb7' b'\x5f\x0c\x79\xd6'
3946
 
 
3947
 
 
3948
 
     def testPackRequest0(self):
3949
 
-        bin = apply(request.ConvertSelection._request.to_binary, (), self.req_args_0)
3950
 
+        bin = request.ConvertSelection._request.to_binary(*(), **self.req_args_0)
3951
 
         try:
3952
 
             assert bin == self.req_bin_0
3953
 
         except AssertionError:
3954
 
@@ -1461,16 +1469,16 @@
3955
 
             'destination': 1369243800,
3956
 
             'event_mask': 1594482936,
3957
 
             }
3958
 
-        self.req_bin_0 = '\x19\x01\x00\x0b' '\x51\x9d\x00\x98' \
3959
 
-            '\x5f\x09\xe0\xf8' '\x0c\x00\x00\x00' \
3960
 
-            '\x4e\xce\xfa\x94' '\xcd\x42\xdb\xfc' \
3961
 
-            '\x40\xe4\xfd\x10' '\x37\x54\x00\x00' \
3962
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3963
 
-            '\x00\x00\x00\x00'
3964
 
+        self.req_bin_0 = b'\x19\x01\x00\x0b' b'\x51\x9d\x00\x98' \
3965
 
+            b'\x5f\x09\xe0\xf8' b'\x0c\x00\x00\x00' \
3966
 
+            b'\x4e\xce\xfa\x94' b'\xcd\x42\xdb\xfc' \
3967
 
+            b'\x40\xe4\xfd\x10' b'\x37\x54\x00\x00' \
3968
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3969
 
+            b'\x00\x00\x00\x00'
3970
 
 
3971
 
 
3972
 
     def testPackRequest0(self):
3973
 
-        bin = apply(request.SendEvent._request.to_binary, (), self.req_args_0)
3974
 
+        bin = request.SendEvent._request.to_binary(*(), **self.req_args_0)
3975
 
         try:
3976
 
             assert bin == self.req_bin_0
3977
 
         except AssertionError:
3978
 
@@ -1500,22 +1508,22 @@
3979
 
             'keyboard_mode': 1,
3980
 
             'cursor': 17101598,
3981
 
             }
3982
 
-        self.req_bin_0 = '\x1a\x01\x00\x06' '\x7d\x75\x91\xbc' \
3983
 
-            '\x08\x1b\x00\x01' '\x76\x82\xb9\x57' \
3984
 
-            '\x01\x04\xf3\x1e' '\x4e\x77\x17\xcc'
3985
 
+        self.req_bin_0 = b'\x1a\x01\x00\x06' b'\x7d\x75\x91\xbc' \
3986
 
+            b'\x08\x1b\x00\x01' b'\x76\x82\xb9\x57' \
3987
 
+            b'\x01\x04\xf3\x1e' b'\x4e\x77\x17\xcc'
3988
 
 
3989
 
         self.reply_args_0 = {
3990
 
             'sequence_number': 47539,
3991
 
             'status': 149,
3992
 
             }
3993
 
-        self.reply_bin_0 = '\x01\x95\xb9\xb3' '\x00\x00\x00\x00' \
3994
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3995
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
3996
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
3997
 
+        self.reply_bin_0 = b'\x01\x95\xb9\xb3' b'\x00\x00\x00\x00' \
3998
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
3999
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4000
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4001
 
 
4002
 
 
4003
 
     def testPackRequest0(self):
4004
 
-        bin = apply(request.GrabPointer._request.to_binary, (), self.req_args_0)
4005
 
+        bin = request.GrabPointer._request.to_binary(*(), **self.req_args_0)
4006
 
         try:
4007
 
             assert bin == self.req_bin_0
4008
 
         except AssertionError:
4009
 
@@ -1533,7 +1541,7 @@
4010
 
             raise AssertionError(args)
4011
 
 
4012
 
     def testPackReply0(self):
4013
 
-        bin = apply(request.GrabPointer._reply.to_binary, (), self.reply_args_0)
4014
 
+        bin = request.GrabPointer._reply.to_binary(*(), **self.reply_args_0)
4015
 
         try:
4016
 
             assert bin == self.reply_bin_0
4017
 
         except AssertionError:
4018
 
@@ -1556,11 +1564,11 @@
4019
 
         self.req_args_0 = {
4020
 
             'time': 209008422,
4021
 
             }
4022
 
-        self.req_bin_0 = '\x1b\x00\x00\x02' '\x0c\x75\x37\x26'
4023
 
+        self.req_bin_0 = b'\x1b\x00\x00\x02' b'\x0c\x75\x37\x26'
4024
 
 
4025
 
 
4026
 
     def testPackRequest0(self):
4027
 
-        bin = apply(request.UngrabPointer._request.to_binary, (), self.req_args_0)
4028
 
+        bin = request.UngrabPointer._request.to_binary(*(), **self.req_args_0)
4029
 
         try:
4030
 
             assert bin == self.req_bin_0
4031
 
         except AssertionError:
4032
 
@@ -1591,13 +1599,13 @@
4033
 
             'keyboard_mode': 1,
4034
 
             'cursor': 1070323643,
4035
 
             }
4036
 
-        self.req_bin_0 = '\x1c\x01\x00\x06' '\x1f\x60\x42\x88' \
4037
 
-            '\x3f\x97\x01\x01' '\x6d\xe8\x6c\x5b' \
4038
 
-            '\x3f\xcb\xd7\xbb' '\xd0\x00\x3c\xe5'
4039
 
+        self.req_bin_0 = b'\x1c\x01\x00\x06' b'\x1f\x60\x42\x88' \
4040
 
+            b'\x3f\x97\x01\x01' b'\x6d\xe8\x6c\x5b' \
4041
 
+            b'\x3f\xcb\xd7\xbb' b'\xd0\x00\x3c\xe5'
4042
 
 
4043
 
 
4044
 
     def testPackRequest0(self):
4045
 
-        bin = apply(request.GrabButton._request.to_binary, (), self.req_args_0)
4046
 
+        bin = request.GrabButton._request.to_binary(*(), **self.req_args_0)
4047
 
         try:
4048
 
             assert bin == self.req_bin_0
4049
 
         except AssertionError:
4050
 
@@ -1622,12 +1630,12 @@
4051
 
             'button': 240,
4052
 
             'modifiers': 51717,
4053
 
             }
4054
 
-        self.req_bin_0 = '\x1d\xf0\x00\x03' '\x2f\x69\x0e\x86' \
4055
 
-            '\xca\x05\x00\x00'
4056
 
+        self.req_bin_0 = b'\x1d\xf0\x00\x03' b'\x2f\x69\x0e\x86' \
4057
 
+            b'\xca\x05\x00\x00'
4058
 
 
4059
 
 
4060
 
     def testPackRequest0(self):
4061
 
-        bin = apply(request.UngrabButton._request.to_binary, (), self.req_args_0)
4062
 
+        bin = request.UngrabButton._request.to_binary(*(), **self.req_args_0)
4063
 
         try:
4064
 
             assert bin == self.req_bin_0
4065
 
         except AssertionError:
4066
 
@@ -1652,12 +1660,12 @@
4067
 
             'event_mask': 23423,
4068
 
             'cursor': 1696594928,
4069
 
             }
4070
 
-        self.req_bin_0 = '\x1e\x00\x00\x04' '\x65\x1f\xfb\xf0' \
4071
 
-            '\x35\x20\xbb\x64' '\x5b\x7f\x00\x00'
4072
 
+        self.req_bin_0 = b'\x1e\x00\x00\x04' b'\x65\x1f\xfb\xf0' \
4073
 
+            b'\x35\x20\xbb\x64' b'\x5b\x7f\x00\x00'
4074
 
 
4075
 
 
4076
 
     def testPackRequest0(self):
4077
 
-        bin = apply(request.ChangeActivePointerGrab._request.to_binary, (), self.req_args_0)
4078
 
+        bin = request.ChangeActivePointerGrab._request.to_binary(*(), **self.req_args_0)
4079
 
         try:
4080
 
             assert bin == self.req_bin_0
4081
 
         except AssertionError:
4082
 
@@ -1684,21 +1692,21 @@
4083
 
             'pointer_mode': 1,
4084
 
             'keyboard_mode': 1,
4085
 
             }
4086
 
-        self.req_bin_0 = '\x1f\x00\x00\x04' '\x04\x89\xaf\x67' \
4087
 
-            '\x5d\x23\x78\xd9' '\x01\x01\x00\x00'
4088
 
+        self.req_bin_0 = b'\x1f\x00\x00\x04' b'\x04\x89\xaf\x67' \
4089
 
+            b'\x5d\x23\x78\xd9' b'\x01\x01\x00\x00'
4090
 
 
4091
 
         self.reply_args_0 = {
4092
 
             'sequence_number': 9648,
4093
 
             'status': 129,
4094
 
             }
4095
 
-        self.reply_bin_0 = '\x01\x81\x25\xb0' '\x00\x00\x00\x00' \
4096
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4097
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4098
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
4099
 
+        self.reply_bin_0 = b'\x01\x81\x25\xb0' b'\x00\x00\x00\x00' \
4100
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4101
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4102
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4103
 
 
4104
 
 
4105
 
     def testPackRequest0(self):
4106
 
-        bin = apply(request.GrabKeyboard._request.to_binary, (), self.req_args_0)
4107
 
+        bin = request.GrabKeyboard._request.to_binary(*(), **self.req_args_0)
4108
 
         try:
4109
 
             assert bin == self.req_bin_0
4110
 
         except AssertionError:
4111
 
@@ -1716,7 +1724,7 @@
4112
 
             raise AssertionError(args)
4113
 
 
4114
 
     def testPackReply0(self):
4115
 
-        bin = apply(request.GrabKeyboard._reply.to_binary, (), self.reply_args_0)
4116
 
+        bin = request.GrabKeyboard._reply.to_binary(*(), **self.reply_args_0)
4117
 
         try:
4118
 
             assert bin == self.reply_bin_0
4119
 
         except AssertionError:
4120
 
@@ -1739,11 +1747,11 @@
4121
 
         self.req_args_0 = {
4122
 
             'time': 1352311886,
4123
 
             }
4124
 
-        self.req_bin_0 = '\x20\x00\x00\x02' '\x50\x9a\xa4\x4e'
4125
 
+        self.req_bin_0 = b'\x20\x00\x00\x02' b'\x50\x9a\xa4\x4e'
4126
 
 
4127
 
 
4128
 
     def testPackRequest0(self):
4129
 
-        bin = apply(request.UngrabKeyboard._request.to_binary, (), self.req_args_0)
4130
 
+        bin = request.UngrabKeyboard._request.to_binary(*(), **self.req_args_0)
4131
 
         try:
4132
 
             assert bin == self.req_bin_0
4133
 
         except AssertionError:
4134
 
@@ -1771,12 +1779,12 @@
4135
 
             'modifiers': 28819,
4136
 
             'key': 193,
4137
 
             }
4138
 
-        self.req_bin_0 = '\x21\x01\x00\x04' '\x57\x78\x21\xf0' \
4139
 
-            '\x70\x93\xc1\x00' '\x00\x00\x00\x00'
4140
 
+        self.req_bin_0 = b'\x21\x01\x00\x04' b'\x57\x78\x21\xf0' \
4141
 
+            b'\x70\x93\xc1\x00' b'\x00\x00\x00\x00'
4142
 
 
4143
 
 
4144
 
     def testPackRequest0(self):
4145
 
-        bin = apply(request.GrabKey._request.to_binary, (), self.req_args_0)
4146
 
+        bin = request.GrabKey._request.to_binary(*(), **self.req_args_0)
4147
 
         try:
4148
 
             assert bin == self.req_bin_0
4149
 
         except AssertionError:
4150
 
@@ -1801,12 +1809,12 @@
4151
 
             'key': 215,
4152
 
             'modifiers': 60588,
4153
 
             }
4154
 
-        self.req_bin_0 = '\x22\xd7\x00\x03' '\x2d\xe4\x31\xbb' \
4155
 
-            '\xec\xac\x00\x00'
4156
 
+        self.req_bin_0 = b'\x22\xd7\x00\x03' b'\x2d\xe4\x31\xbb' \
4157
 
+            b'\xec\xac\x00\x00'
4158
 
 
4159
 
 
4160
 
     def testPackRequest0(self):
4161
 
-        bin = apply(request.UngrabKey._request.to_binary, (), self.req_args_0)
4162
 
+        bin = request.UngrabKey._request.to_binary(*(), **self.req_args_0)
4163
 
         try:
4164
 
             assert bin == self.req_bin_0
4165
 
         except AssertionError:
4166
 
@@ -1830,11 +1838,11 @@
4167
 
             'time': 342147129,
4168
 
             'mode': 1,
4169
 
             }
4170
 
-        self.req_bin_0 = '\x23\x01\x00\x02' '\x14\x64\xc0\x39'
4171
 
+        self.req_bin_0 = b'\x23\x01\x00\x02' b'\x14\x64\xc0\x39'
4172
 
 
4173
 
 
4174
 
     def testPackRequest0(self):
4175
 
-        bin = apply(request.AllowEvents._request.to_binary, (), self.req_args_0)
4176
 
+        bin = request.AllowEvents._request.to_binary(*(), **self.req_args_0)
4177
 
         try:
4178
 
             assert bin == self.req_bin_0
4179
 
         except AssertionError:
4180
 
@@ -1856,11 +1864,11 @@
4181
 
     def setUp(self):
4182
 
         self.req_args_0 = {
4183
 
             }
4184
 
-        self.req_bin_0 = '\x24\x00\x00\x01'
4185
 
+        self.req_bin_0 = b'\x24\x00\x00\x01'
4186
 
 
4187
 
 
4188
 
     def testPackRequest0(self):
4189
 
-        bin = apply(request.GrabServer._request.to_binary, (), self.req_args_0)
4190
 
+        bin = request.GrabServer._request.to_binary(*(), **self.req_args_0)
4191
 
         try:
4192
 
             assert bin == self.req_bin_0
4193
 
         except AssertionError:
4194
 
@@ -1882,11 +1890,11 @@
4195
 
     def setUp(self):
4196
 
         self.req_args_0 = {
4197
 
             }
4198
 
-        self.req_bin_0 = '\x25\x00\x00\x01'
4199
 
+        self.req_bin_0 = b'\x25\x00\x00\x01'
4200
 
 
4201
 
 
4202
 
     def testPackRequest0(self):
4203
 
-        bin = apply(request.UngrabServer._request.to_binary, (), self.req_args_0)
4204
 
+        bin = request.UngrabServer._request.to_binary(*(), **self.req_args_0)
4205
 
         try:
4206
 
             assert bin == self.req_bin_0
4207
 
         except AssertionError:
4208
 
@@ -1909,7 +1917,7 @@
4209
 
         self.req_args_0 = {
4210
 
             'window': 561336799,
4211
 
             }
4212
 
-        self.req_bin_0 = '\x26\x00\x00\x02' '\x21\x75\x51\xdf'
4213
 
+        self.req_bin_0 = b'\x26\x00\x00\x02' b'\x21\x75\x51\xdf'
4214
 
 
4215
 
         self.reply_args_0 = {
4216
 
             'win_y': -25733,
4217
 
@@ -1922,14 +1930,14 @@
4218
 
             'child': 1075058918,
4219
 
             'win_x': -18858,
4220
 
             }
4221
 
-        self.reply_bin_0 = '\x01\x00\xa1\xe8' '\x00\x00\x00\x00' \
4222
 
-            '\x5f\x52\x73\x56' '\x40\x14\x18\xe6' \
4223
 
-            '\xef\xa7\xe8\x20' '\xb6\x56\x9b\x7b' \
4224
 
-            '\x8c\x73\x00\x00' '\x00\x00\x00\x00'
4225
 
+        self.reply_bin_0 = b'\x01\x00\xa1\xe8' b'\x00\x00\x00\x00' \
4226
 
+            b'\x5f\x52\x73\x56' b'\x40\x14\x18\xe6' \
4227
 
+            b'\xef\xa7\xe8\x20' b'\xb6\x56\x9b\x7b' \
4228
 
+            b'\x8c\x73\x00\x00' b'\x00\x00\x00\x00'
4229
 
 
4230
 
 
4231
 
     def testPackRequest0(self):
4232
 
-        bin = apply(request.QueryPointer._request.to_binary, (), self.req_args_0)
4233
 
+        bin = request.QueryPointer._request.to_binary(*(), **self.req_args_0)
4234
 
         try:
4235
 
             assert bin == self.req_bin_0
4236
 
         except AssertionError:
4237
 
@@ -1947,7 +1955,7 @@
4238
 
             raise AssertionError(args)
4239
 
 
4240
 
     def testPackReply0(self):
4241
 
-        bin = apply(request.QueryPointer._reply.to_binary, (), self.reply_args_0)
4242
 
+        bin = request.QueryPointer._reply.to_binary(*(), **self.reply_args_0)
4243
 
         try:
4244
 
             assert bin == self.reply_bin_0
4245
 
         except AssertionError:
4246
 
@@ -1972,26 +1980,26 @@
4247
 
             'start': 1520150500,
4248
 
             'stop': 11115313,
4249
 
             }
4250
 
-        self.req_bin_0 = '\x27\x00\x00\x04' '\x32\x49\x8f\xf4' \
4251
 
-            '\x5a\x9b\xa7\xe4' '\x00\xa9\x9b\x31'
4252
 
+        self.req_bin_0 = b'\x27\x00\x00\x04' b'\x32\x49\x8f\xf4' \
4253
 
+            b'\x5a\x9b\xa7\xe4' b'\x00\xa9\x9b\x31'
4254
 
 
4255
 
         self.reply_args_0 = {
4256
 
             'sequence_number': 52222,
4257
 
             'events': [{'time': 2107444516, 'x': -649, 'y': -11631}, {'time': 1827536960, 'x': -18061, 'y': -2301}, {'time': 554175146, 'x': -32111, 'y': -13522}, {'time': 608168588, 'x': -5963, 'y': -24618}, {'time': 590416221, 'x': -3325, 'y': -19656}],
4258
 
             }
4259
 
-        self.reply_bin_0 = '\x01\x00\xcb\xfe' '\x00\x00\x00\x0a' \
4260
 
-            '\x00\x00\x00\x05' '\x00\x00\x00\x00' \
4261
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4262
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4263
 
-            '\x7d\x9d\x0d\x24' '\xfd\x77\xd2\x91' \
4264
 
-            '\x6c\xee\x00\x40' '\xb9\x73\xf7\x03' \
4265
 
-            '\x21\x08\x0a\xaa' '\x82\x91\xcb\x2e' \
4266
 
-            '\x24\x3f\xea\x8c' '\xe8\xb5\x9f\xd6' \
4267
 
-            '\x23\x31\x09\x5d' '\xf3\x03\xb3\x38'
4268
 
+        self.reply_bin_0 = b'\x01\x00\xcb\xfe' b'\x00\x00\x00\x0a' \
4269
 
+            b'\x00\x00\x00\x05' b'\x00\x00\x00\x00' \
4270
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4271
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4272
 
+            b'\x7d\x9d\x0d\x24' b'\xfd\x77\xd2\x91' \
4273
 
+            b'\x6c\xee\x00\x40' b'\xb9\x73\xf7\x03' \
4274
 
+            b'\x21\x08\x0a\xaa' b'\x82\x91\xcb\x2e' \
4275
 
+            b'\x24\x3f\xea\x8c' b'\xe8\xb5\x9f\xd6' \
4276
 
+            b'\x23\x31\x09\x5d' b'\xf3\x03\xb3\x38'
4277
 
 
4278
 
 
4279
 
     def testPackRequest0(self):
4280
 
-        bin = apply(request.GetMotionEvents._request.to_binary, (), self.req_args_0)
4281
 
+        bin = request.GetMotionEvents._request.to_binary(*(), **self.req_args_0)
4282
 
         try:
4283
 
             assert bin == self.req_bin_0
4284
 
         except AssertionError:
4285
 
@@ -2009,7 +2017,7 @@
4286
 
             raise AssertionError(args)
4287
 
 
4288
 
     def testPackReply0(self):
4289
 
-        bin = apply(request.GetMotionEvents._reply.to_binary, (), self.reply_args_0)
4290
 
+        bin = request.GetMotionEvents._reply.to_binary(*(), **self.reply_args_0)
4291
 
         try:
4292
 
             assert bin == self.reply_bin_0
4293
 
         except AssertionError:
4294
 
@@ -2035,8 +2043,8 @@
4295
 
             'src_wid': 257619448,
4296
 
             'dst_wid': 1238981863,
4297
 
             }
4298
 
-        self.req_bin_0 = '\x28\x00\x00\x04' '\x0f\x5a\xf5\xf8' \
4299
 
-            '\x49\xd9\x5c\xe7' '\x9d\x0d\x95\x91'
4300
 
+        self.req_bin_0 = b'\x28\x00\x00\x04' b'\x0f\x5a\xf5\xf8' \
4301
 
+            b'\x49\xd9\x5c\xe7' b'\x9d\x0d\x95\x91'
4302
 
 
4303
 
         self.reply_args_0 = {
4304
 
             'child': 2050350678,
4305
 
@@ -2045,14 +2053,14 @@
4306
 
             'x': -18096,
4307
 
             'y': -5252,
4308
 
             }
4309
 
-        self.reply_bin_0 = '\x01\x01\x97\x01' '\x00\x00\x00\x00' \
4310
 
-            '\x7a\x35\xde\x56' '\xb9\x50\xeb\x7c' \
4311
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4312
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
4313
 
+        self.reply_bin_0 = b'\x01\x01\x97\x01' b'\x00\x00\x00\x00' \
4314
 
+            b'\x7a\x35\xde\x56' b'\xb9\x50\xeb\x7c' \
4315
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4316
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4317
 
 
4318
 
 
4319
 
     def testPackRequest0(self):
4320
 
-        bin = apply(request.TranslateCoords._request.to_binary, (), self.req_args_0)
4321
 
+        bin = request.TranslateCoords._request.to_binary(*(), **self.req_args_0)
4322
 
         try:
4323
 
             assert bin == self.req_bin_0
4324
 
         except AssertionError:
4325
 
@@ -2070,7 +2078,7 @@
4326
 
             raise AssertionError(args)
4327
 
 
4328
 
     def testPackReply0(self):
4329
 
-        bin = apply(request.TranslateCoords._reply.to_binary, (), self.reply_args_0)
4330
 
+        bin = request.TranslateCoords._reply.to_binary(*(), **self.reply_args_0)
4331
 
         try:
4332
 
             assert bin == self.reply_bin_0
4333
 
         except AssertionError:
4334
 
@@ -2100,13 +2108,13 @@
4335
 
             'dst_x': -30516,
4336
 
             'dst_y': -24204,
4337
 
             }
4338
 
-        self.req_bin_0 = '\x29\x00\x00\x06' '\x4f\x93\xba\xef' \
4339
 
-            '\x28\x44\x07\xf4' '\x96\x11\x9a\x29' \
4340
 
-            '\x55\x31\xdd\x3a' '\x88\xcc\xa1\x74'
4341
 
+        self.req_bin_0 = b'\x29\x00\x00\x06' b'\x4f\x93\xba\xef' \
4342
 
+            b'\x28\x44\x07\xf4' b'\x96\x11\x9a\x29' \
4343
 
+            b'\x55\x31\xdd\x3a' b'\x88\xcc\xa1\x74'
4344
 
 
4345
 
 
4346
 
     def testPackRequest0(self):
4347
 
-        bin = apply(request.WarpPointer._request.to_binary, (), self.req_args_0)
4348
 
+        bin = request.WarpPointer._request.to_binary(*(), **self.req_args_0)
4349
 
         try:
4350
 
             assert bin == self.req_bin_0
4351
 
         except AssertionError:
4352
 
@@ -2131,12 +2139,12 @@
4353
 
             'time': 1079702500,
4354
 
             'focus': 1026400247,
4355
 
             }
4356
 
-        self.req_bin_0 = '\x2a\x01\x00\x03' '\x3d\x2d\x9f\xf7' \
4357
 
-            '\x40\x5a\xf3\xe4'
4358
 
+        self.req_bin_0 = b'\x2a\x01\x00\x03' b'\x3d\x2d\x9f\xf7' \
4359
 
+            b'\x40\x5a\xf3\xe4'
4360
 
 
4361
 
 
4362
 
     def testPackRequest0(self):
4363
 
-        bin = apply(request.SetInputFocus._request.to_binary, (), self.req_args_0)
4364
 
+        bin = request.SetInputFocus._request.to_binary(*(), **self.req_args_0)
4365
 
         try:
4366
 
             assert bin == self.req_bin_0
4367
 
         except AssertionError:
4368
 
@@ -2158,21 +2166,21 @@
4369
 
     def setUp(self):
4370
 
         self.req_args_0 = {
4371
 
             }
4372
 
-        self.req_bin_0 = '\x2b\x00\x00\x01'
4373
 
+        self.req_bin_0 = b'\x2b\x00\x00\x01'
4374
 
 
4375
 
         self.reply_args_0 = {
4376
 
             'revert_to': 152,
4377
 
             'sequence_number': 16002,
4378
 
             'focus': 2024022965,
4379
 
             }
4380
 
-        self.reply_bin_0 = '\x01\x98\x3e\x82' '\x00\x00\x00\x00' \
4381
 
-            '\x78\xa4\x23\xb5' '\x00\x00\x00\x00' \
4382
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4383
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
4384
 
+        self.reply_bin_0 = b'\x01\x98\x3e\x82' b'\x00\x00\x00\x00' \
4385
 
+            b'\x78\xa4\x23\xb5' b'\x00\x00\x00\x00' \
4386
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4387
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4388
 
 
4389
 
 
4390
 
     def testPackRequest0(self):
4391
 
-        bin = apply(request.GetInputFocus._request.to_binary, (), self.req_args_0)
4392
 
+        bin = request.GetInputFocus._request.to_binary(*(), **self.req_args_0)
4393
 
         try:
4394
 
             assert bin == self.req_bin_0
4395
 
         except AssertionError:
4396
 
@@ -2190,7 +2198,7 @@
4397
 
             raise AssertionError(args)
4398
 
 
4399
 
     def testPackReply0(self):
4400
 
-        bin = apply(request.GetInputFocus._reply.to_binary, (), self.reply_args_0)
4401
 
+        bin = request.GetInputFocus._reply.to_binary(*(), **self.reply_args_0)
4402
 
         try:
4403
 
             assert bin == self.reply_bin_0
4404
 
         except AssertionError:
4405
 
@@ -2212,21 +2220,21 @@
4406
 
     def setUp(self):
4407
 
         self.req_args_0 = {
4408
 
             }
4409
 
-        self.req_bin_0 = '\x2c\x00\x00\x01'
4410
 
+        self.req_bin_0 = b'\x2c\x00\x00\x01'
4411
 
 
4412
 
         self.reply_args_0 = {
4413
 
             'sequence_number': 16233,
4414
 
             'map': [186, 167, 191, 213, 241, 231, 234, 175, 154, 169, 132, 146, 215, 191, 196, 212, 158, 156, 177, 233, 220, 192, 130, 226, 181, 233, 238, 141, 129, 215, 245, 215],
4415
 
             }
4416
 
-        self.reply_bin_0 = '\x01\x00\x3f\x69' '\x00\x00\x00\x02' \
4417
 
-            '\xba\xa7\xbf\xd5' '\xf1\xe7\xea\xaf' \
4418
 
-            '\x9a\xa9\x84\x92' '\xd7\xbf\xc4\xd4' \
4419
 
-            '\x9e\x9c\xb1\xe9' '\xdc\xc0\x82\xe2' \
4420
 
-            '\xb5\xe9\xee\x8d' '\x81\xd7\xf5\xd7'
4421
 
+        self.reply_bin_0 = b'\x01\x00\x3f\x69' b'\x00\x00\x00\x02' \
4422
 
+            b'\xba\xa7\xbf\xd5' b'\xf1\xe7\xea\xaf' \
4423
 
+            b'\x9a\xa9\x84\x92' b'\xd7\xbf\xc4\xd4' \
4424
 
+            b'\x9e\x9c\xb1\xe9' b'\xdc\xc0\x82\xe2' \
4425
 
+            b'\xb5\xe9\xee\x8d' b'\x81\xd7\xf5\xd7'
4426
 
 
4427
 
 
4428
 
     def testPackRequest0(self):
4429
 
-        bin = apply(request.QueryKeymap._request.to_binary, (), self.req_args_0)
4430
 
+        bin = request.QueryKeymap._request.to_binary(*(), **self.req_args_0)
4431
 
         try:
4432
 
             assert bin == self.req_bin_0
4433
 
         except AssertionError:
4434
 
@@ -2244,7 +2252,7 @@
4435
 
             raise AssertionError(args)
4436
 
 
4437
 
     def testPackReply0(self):
4438
 
-        bin = apply(request.QueryKeymap._reply.to_binary, (), self.reply_args_0)
4439
 
+        bin = request.QueryKeymap._reply.to_binary(*(), **self.reply_args_0)
4440
 
         try:
4441
 
             assert bin == self.reply_bin_0
4442
 
         except AssertionError:
4443
 
@@ -2268,13 +2276,13 @@
4444
 
             'fid': 1728036313,
4445
 
             'name': 'foofont',
4446
 
             }
4447
 
-        self.req_bin_0 = '\x2d\x00\x00\x05' '\x66\xff\xbd\xd9' \
4448
 
-            '\x00\x07\x00\x00' '\x66\x6f\x6f\x66' \
4449
 
-            '\x6f\x6e\x74\x00'
4450
 
+        self.req_bin_0 = b'\x2d\x00\x00\x05' b'\x66\xff\xbd\xd9' \
4451
 
+            b'\x00\x07\x00\x00' b'\x66\x6f\x6f\x66' \
4452
 
+            b'\x6f\x6e\x74\x00'
4453
 
 
4454
 
 
4455
 
     def testPackRequest0(self):
4456
 
-        bin = apply(request.OpenFont._request.to_binary, (), self.req_args_0)
4457
 
+        bin = request.OpenFont._request.to_binary(*(), **self.req_args_0)
4458
 
         try:
4459
 
             assert bin == self.req_bin_0
4460
 
         except AssertionError:
4461
 
@@ -2297,11 +2305,11 @@
4462
 
         self.req_args_0 = {
4463
 
             'font': 1139770507,
4464
 
             }
4465
 
-        self.req_bin_0 = '\x2e\x00\x00\x02' '\x43\xef\x84\x8b'
4466
 
+        self.req_bin_0 = b'\x2e\x00\x00\x02' b'\x43\xef\x84\x8b'
4467
 
 
4468
 
 
4469
 
     def testPackRequest0(self):
4470
 
-        bin = apply(request.CloseFont._request.to_binary, (), self.req_args_0)
4471
 
+        bin = request.CloseFont._request.to_binary(*(), **self.req_args_0)
4472
 
         try:
4473
 
             assert bin == self.req_bin_0
4474
 
         except AssertionError:
4475
 
@@ -2324,7 +2332,7 @@
4476
 
         self.req_args_0 = {
4477
 
             'font': 1867659050,
4478
 
             }
4479
 
-        self.req_bin_0 = '\x2f\x00\x00\x02' '\x6f\x52\x37\x2a'
4480
 
+        self.req_bin_0 = b'\x2f\x00\x00\x02' b'\x6f\x52\x37\x2a'
4481
 
 
4482
 
         self.reply_args_0 = {
4483
 
             'sequence_number': 8877,
4484
 
@@ -2342,23 +2350,23 @@
4485
 
             'font_descent': -23067,
4486
 
             'max_bounds': {'descent': -24292, 'ascent': -26972, 'character_width': -19286, 'left_side_bearing': -16363, 'right_side_bearing': -3149, 'attributes': 35968},
4487
 
             }
4488
 
-        self.reply_bin_0 = '\x01\x00\x22\xad' '\x00\x00\x00\x12' \
4489
 
-            '\xae\xfc\xab\x3e' '\xeb\x5a\x96\x67' \
4490
 
-            '\x8b\x8b\x2c\x80' '\x00\x00\x00\x00' \
4491
 
-            '\xc0\x15\xf3\xb3' '\xb4\xaa\x96\xa4' \
4492
 
-            '\xa1\x1c\x8c\x80' '\x00\x00\x00\x00' \
4493
 
-            '\xc0\xd0\x09\xd4' '\x23\x22\x00\x01' \
4494
 
-            '\x8f\xbe\xa8\x01' '\xc2\xe2\xa5\xe5' \
4495
 
-            '\x00\x00\x00\x03' '\x56\x76\x30\xf3' \
4496
 
-            '\x7d\xc9\x5e\x19' '\xee\x57\xd9\x6d' \
4497
 
-            '\x90\x97\xc7\x8a' '\xfe\xb5\xd7\x97' \
4498
 
-            '\xb0\x53\x9d\x9d' '\xee\x4c\xe7\x7a' \
4499
 
-            '\xb6\xcd\x73\x24' '\xb1\x9c\xfc\x76' \
4500
 
-            '\xaa\xa1\xf6\xb6' '\xb8\x33\x86\x51'
4501
 
+        self.reply_bin_0 = b'\x01\x00\x22\xad' b'\x00\x00\x00\x12' \
4502
 
+            b'\xae\xfc\xab\x3e' b'\xeb\x5a\x96\x67' \
4503
 
+            b'\x8b\x8b\x2c\x80' b'\x00\x00\x00\x00' \
4504
 
+            b'\xc0\x15\xf3\xb3' b'\xb4\xaa\x96\xa4' \
4505
 
+            b'\xa1\x1c\x8c\x80' b'\x00\x00\x00\x00' \
4506
 
+            b'\xc0\xd0\x09\xd4' b'\x23\x22\x00\x01' \
4507
 
+            b'\x8f\xbe\xa8\x01' b'\xc2\xe2\xa5\xe5' \
4508
 
+            b'\x00\x00\x00\x03' b'\x56\x76\x30\xf3' \
4509
 
+            b'\x7d\xc9\x5e\x19' b'\xee\x57\xd9\x6d' \
4510
 
+            b'\x90\x97\xc7\x8a' b'\xfe\xb5\xd7\x97' \
4511
 
+            b'\xb0\x53\x9d\x9d' b'\xee\x4c\xe7\x7a' \
4512
 
+            b'\xb6\xcd\x73\x24' b'\xb1\x9c\xfc\x76' \
4513
 
+            b'\xaa\xa1\xf6\xb6' b'\xb8\x33\x86\x51'
4514
 
 
4515
 
 
4516
 
     def testPackRequest0(self):
4517
 
-        bin = apply(request.QueryFont._request.to_binary, (), self.req_args_0)
4518
 
+        bin = request.QueryFont._request.to_binary(*(), **self.req_args_0)
4519
 
         try:
4520
 
             assert bin == self.req_bin_0
4521
 
         except AssertionError:
4522
 
@@ -2376,7 +2384,7 @@
4523
 
             raise AssertionError(args)
4524
 
 
4525
 
     def testPackReply0(self):
4526
 
-        bin = apply(request.QueryFont._reply.to_binary, (), self.reply_args_0)
4527
 
+        bin = request.QueryFont._reply.to_binary(*(), **self.reply_args_0)
4528
 
         try:
4529
 
             assert bin == self.reply_bin_0
4530
 
         except AssertionError:
4531
 
@@ -2400,8 +2408,8 @@
4532
 
             'font': 1562125736,
4533
 
             'string': (102, 111, 111),
4534
 
             }
4535
 
-        self.req_bin_0 = '\x30\x01\x00\x04' '\x5d\x1c\x25\xa8' \
4536
 
-            '\x00\x66\x00\x6f' '\x00\x6f\x00\x00'
4537
 
+        self.req_bin_0 = b'\x30\x01\x00\x04' b'\x5d\x1c\x25\xa8' \
4538
 
+            b'\x00\x66\x00\x6f' b'\x00\x6f\x00\x00'
4539
 
 
4540
 
         self.reply_args_0 = {
4541
 
             'overall_width': -1378352414,
4542
 
@@ -2414,14 +2422,14 @@
4543
 
             'overall_left': -1046976699,
4544
 
             'font_descent': -14179,
4545
 
             }
4546
 
-        self.reply_bin_0 = '\x01\xdb\x1a\x87' '\x00\x00\x00\x00' \
4547
 
-            '\xbd\xed\xc8\x9d' '\xa6\x82\xf8\xfd' \
4548
 
-            '\xad\xd8\x02\xe2' '\xc1\x98\x67\x45' \
4549
 
-            '\xe0\x64\x80\xea' '\x00\x00\x00\x00'
4550
 
+        self.reply_bin_0 = b'\x01\xdb\x1a\x87' b'\x00\x00\x00\x00' \
4551
 
+            b'\xbd\xed\xc8\x9d' b'\xa6\x82\xf8\xfd' \
4552
 
+            b'\xad\xd8\x02\xe2' b'\xc1\x98\x67\x45' \
4553
 
+            b'\xe0\x64\x80\xea' b'\x00\x00\x00\x00'
4554
 
 
4555
 
 
4556
 
     def testPackRequest0(self):
4557
 
-        bin = apply(request.QueryTextExtents._request.to_binary, (), self.req_args_0)
4558
 
+        bin = request.QueryTextExtents._request.to_binary(*(), **self.req_args_0)
4559
 
         try:
4560
 
             assert bin == self.req_bin_0
4561
 
         except AssertionError:
4562
 
@@ -2439,7 +2447,7 @@
4563
 
             raise AssertionError(args)
4564
 
 
4565
 
     def testPackReply0(self):
4566
 
-        bin = apply(request.QueryTextExtents._reply.to_binary, (), self.reply_args_0)
4567
 
+        bin = request.QueryTextExtents._reply.to_binary(*(), **self.reply_args_0)
4568
 
         try:
4569
 
             assert bin == self.reply_bin_0
4570
 
         except AssertionError:
4571
 
@@ -2463,24 +2471,24 @@
4572
 
             'max_names': 53961,
4573
 
             'pattern': 'bhazr',
4574
 
             }
4575
 
-        self.req_bin_0 = '\x31\x00\x00\x04' '\xd2\xc9\x00\x05' \
4576
 
-            '\x62\x68\x61\x7a' '\x72\x00\x00\x00'
4577
 
+        self.req_bin_0 = b'\x31\x00\x00\x04' b'\xd2\xc9\x00\x05' \
4578
 
+            b'\x62\x68\x61\x7a' b'\x72\x00\x00\x00'
4579
 
 
4580
 
         self.reply_args_0 = {
4581
 
             'fonts': ['fie', 'fuzzy', 'foozooom'],
4582
 
             'sequence_number': 38267,
4583
 
             }
4584
 
-        self.reply_bin_0 = '\x01\x00\x95\x7b' '\x00\x00\x00\x05' \
4585
 
-            '\x00\x03\x00\x00' '\x00\x00\x00\x00' \
4586
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4587
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4588
 
-            '\x03\x66\x69\x65' '\x05\x66\x75\x7a' \
4589
 
-            '\x7a\x79\x08\x66' '\x6f\x6f\x7a\x6f' \
4590
 
-            '\x6f\x6f\x6d\x00'
4591
 
+        self.reply_bin_0 = b'\x01\x00\x95\x7b' b'\x00\x00\x00\x05' \
4592
 
+            b'\x00\x03\x00\x00' b'\x00\x00\x00\x00' \
4593
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4594
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4595
 
+            b'\x03\x66\x69\x65' b'\x05\x66\x75\x7a' \
4596
 
+            b'\x7a\x79\x08\x66' b'\x6f\x6f\x7a\x6f' \
4597
 
+            b'\x6f\x6f\x6d\x00'
4598
 
 
4599
 
 
4600
 
     def testPackRequest0(self):
4601
 
-        bin = apply(request.ListFonts._request.to_binary, (), self.req_args_0)
4602
 
+        bin = request.ListFonts._request.to_binary(*(), **self.req_args_0)
4603
 
         try:
4604
 
             assert bin == self.req_bin_0
4605
 
         except AssertionError:
4606
 
@@ -2498,7 +2506,7 @@
4607
 
             raise AssertionError(args)
4608
 
 
4609
 
     def testPackReply0(self):
4610
 
-        bin = apply(request.ListFonts._reply.to_binary, (), self.reply_args_0)
4611
 
+        bin = request.ListFonts._reply.to_binary(*(), **self.reply_args_0)
4612
 
         try:
4613
 
             assert bin == self.reply_bin_0
4614
 
         except AssertionError:
4615
 
@@ -2522,8 +2530,8 @@
4616
 
             'max_names': 46571,
4617
 
             'pattern': 'bhazr2',
4618
 
             }
4619
 
-        self.req_bin_0 = '\x32\x00\x00\x04' '\xb5\xeb\x00\x06' \
4620
 
-            '\x62\x68\x61\x7a' '\x72\x32\x00\x00'
4621
 
+        self.req_bin_0 = b'\x32\x00\x00\x04' b'\xb5\xeb\x00\x06' \
4622
 
+            b'\x62\x68\x61\x7a' b'\x72\x32\x00\x00'
4623
 
 
4624
 
         self.reply_args_0 = {
4625
 
             'sequence_number': 20014,
4626
 
@@ -2542,20 +2550,20 @@
4627
 
             'font_descent': -28978,
4628
 
             'max_bounds': {'descent': -20692, 'ascent': -6999, 'character_width': -15180, 'left_side_bearing': -7789, 'right_side_bearing': -5339, 'attributes': 1068},
4629
 
             }
4630
 
-        self.reply_bin_0 = '\x01\x08\x4e\x2e' '\x00\x00\x00\x0b' \
4631
 
-            '\x8b\xb9\x83\x5c' '\xcd\x1e\xc6\x49' \
4632
 
-            '\x93\x43\x09\xa1' '\x00\x00\x00\x00' \
4633
 
-            '\xe1\x93\xeb\x25' '\xc4\xb4\xe4\xa9' \
4634
 
-            '\xaf\x2c\x04\x2c' '\x00\x00\x00\x00' \
4635
 
-            '\x68\x0e\x09\xaf' '\x42\x91\x00\x01' \
4636
 
-            '\xc0\xd6\xd9\x00' '\x88\xaa\x8e\xce' \
4637
 
-            '\x76\x53\x9a\xa2' '\x19\xfc\x2b\xb0' \
4638
 
-            '\x7d\xca\x9c\xc9' '\x66\x6f\x6e\x74' \
4639
 
-            '\x66\x6f\x6e\x74'
4640
 
+        self.reply_bin_0 = b'\x01\x08\x4e\x2e' b'\x00\x00\x00\x0b' \
4641
 
+            b'\x8b\xb9\x83\x5c' b'\xcd\x1e\xc6\x49' \
4642
 
+            b'\x93\x43\x09\xa1' b'\x00\x00\x00\x00' \
4643
 
+            b'\xe1\x93\xeb\x25' b'\xc4\xb4\xe4\xa9' \
4644
 
+            b'\xaf\x2c\x04\x2c' b'\x00\x00\x00\x00' \
4645
 
+            b'\x68\x0e\x09\xaf' b'\x42\x91\x00\x01' \
4646
 
+            b'\xc0\xd6\xd9\x00' b'\x88\xaa\x8e\xce' \
4647
 
+            b'\x76\x53\x9a\xa2' b'\x19\xfc\x2b\xb0' \
4648
 
+            b'\x7d\xca\x9c\xc9' b'\x66\x6f\x6e\x74' \
4649
 
+            b'\x66\x6f\x6e\x74'
4650
 
 
4651
 
 
4652
 
     def testPackRequest0(self):
4653
 
-        bin = apply(request.ListFontsWithInfo._request.to_binary, (), self.req_args_0)
4654
 
+        bin = request.ListFontsWithInfo._request.to_binary(*(), **self.req_args_0)
4655
 
         try:
4656
 
             assert bin == self.req_bin_0
4657
 
         except AssertionError:
4658
 
@@ -2573,7 +2581,7 @@
4659
 
             raise AssertionError(args)
4660
 
 
4661
 
     def testPackReply0(self):
4662
 
-        bin = apply(request.ListFontsWithInfo._reply.to_binary, (), self.reply_args_0)
4663
 
+        bin = request.ListFontsWithInfo._reply.to_binary(*(), **self.reply_args_0)
4664
 
         try:
4665
 
             assert bin == self.reply_bin_0
4666
 
         except AssertionError:
4667
 
@@ -2596,18 +2604,18 @@
4668
 
         self.req_args_0 = {
4669
 
             'path': ['foo', 'bar', 'gazonk'],
4670
 
             }
4671
 
-        self.req_bin_0 = '\x33\x00\x00\x06' '\x00\x03\x00\x00' \
4672
 
-            '\x03\x66\x6f\x6f' '\x03\x62\x61\x72' \
4673
 
-            '\x06\x67\x61\x7a' '\x6f\x6e\x6b\x00'
4674
 
+        self.req_bin_0 = b'\x33\x00\x00\x06' b'\x00\x03\x00\x00' \
4675
 
+            b'\x03\x66\x6f\x6f' b'\x03\x62\x61\x72' \
4676
 
+            b'\x06\x67\x61\x7a' b'\x6f\x6e\x6b\x00'
4677
 
 
4678
 
         self.req_args_1 = {
4679
 
             'path': [],
4680
 
             }
4681
 
-        self.req_bin_1 = '\x33\x00\x00\x02' '\x00\x00\x00\x00'
4682
 
+        self.req_bin_1 = b'\x33\x00\x00\x02' b'\x00\x00\x00\x00'
4683
 
 
4684
 
 
4685
 
     def testPackRequest0(self):
4686
 
-        bin = apply(request.SetFontPath._request.to_binary, (), self.req_args_0)
4687
 
+        bin = request.SetFontPath._request.to_binary(*(), **self.req_args_0)
4688
 
         try:
4689
 
             assert bin == self.req_bin_0
4690
 
         except AssertionError:
4691
 
@@ -2625,7 +2633,7 @@
4692
 
             raise AssertionError(args)
4693
 
 
4694
 
     def testPackRequest1(self):
4695
 
-        bin = apply(request.SetFontPath._request.to_binary, (), self.req_args_1)
4696
 
+        bin = request.SetFontPath._request.to_binary(*(), **self.req_args_1)
4697
 
         try:
4698
 
             assert bin == self.req_bin_1
4699
 
         except AssertionError:
4700
 
@@ -2647,31 +2655,31 @@
4701
 
     def setUp(self):
4702
 
         self.req_args_0 = {
4703
 
             }
4704
 
-        self.req_bin_0 = '\x34\x00\x00\x01'
4705
 
+        self.req_bin_0 = b'\x34\x00\x00\x01'
4706
 
 
4707
 
         self.reply_args_0 = {
4708
 
             'sequence_number': 21510,
4709
 
             'paths': ['path1', 'path2232'],
4710
 
             }
4711
 
-        self.reply_bin_0 = '\x01\x00\x54\x06' '\x00\x00\x00\x04' \
4712
 
-            '\x00\x02\x00\x00' '\x00\x00\x00\x00' \
4713
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4714
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4715
 
-            '\x05\x70\x61\x74' '\x68\x31\x08\x70' \
4716
 
-            '\x61\x74\x68\x32' '\x32\x33\x32\x00'
4717
 
+        self.reply_bin_0 = b'\x01\x00\x54\x06' b'\x00\x00\x00\x04' \
4718
 
+            b'\x00\x02\x00\x00' b'\x00\x00\x00\x00' \
4719
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4720
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4721
 
+            b'\x05\x70\x61\x74' b'\x68\x31\x08\x70' \
4722
 
+            b'\x61\x74\x68\x32' b'\x32\x33\x32\x00'
4723
 
 
4724
 
         self.reply_args_1 = {
4725
 
             'sequence_number': 62463,
4726
 
             'paths': [],
4727
 
             }
4728
 
-        self.reply_bin_1 = '\x01\x00\xf3\xff' '\x00\x00\x00\x00' \
4729
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4730
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4731
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
4732
 
+        self.reply_bin_1 = b'\x01\x00\xf3\xff' b'\x00\x00\x00\x00' \
4733
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4734
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4735
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
4736
 
 
4737
 
 
4738
 
     def testPackRequest0(self):
4739
 
-        bin = apply(request.GetFontPath._request.to_binary, (), self.req_args_0)
4740
 
+        bin = request.GetFontPath._request.to_binary(*(), **self.req_args_0)
4741
 
         try:
4742
 
             assert bin == self.req_bin_0
4743
 
         except AssertionError:
4744
 
@@ -2689,7 +2697,7 @@
4745
 
             raise AssertionError(args)
4746
 
 
4747
 
     def testPackReply0(self):
4748
 
-        bin = apply(request.GetFontPath._reply.to_binary, (), self.reply_args_0)
4749
 
+        bin = request.GetFontPath._reply.to_binary(*(), **self.reply_args_0)
4750
 
         try:
4751
 
             assert bin == self.reply_bin_0
4752
 
         except AssertionError:
4753
 
@@ -2707,7 +2715,7 @@
4754
 
             raise AssertionError(args)
4755
 
 
4756
 
     def testPackReply1(self):
4757
 
-        bin = apply(request.GetFontPath._reply.to_binary, (), self.reply_args_1)
4758
 
+        bin = request.GetFontPath._reply.to_binary(*(), **self.reply_args_1)
4759
 
         try:
4760
 
             assert bin == self.reply_bin_1
4761
 
         except AssertionError:
4762
 
@@ -2734,12 +2742,12 @@
4763
 
             'depth': 145,
4764
 
             'width': 5641,
4765
 
             }
4766
 
-        self.req_bin_0 = '\x35\x91\x00\x04' '\x37\x39\x21\x50' \
4767
 
-            '\x09\xab\xe8\xd2' '\x16\x09\xff\xeb'
4768
 
+        self.req_bin_0 = b'\x35\x91\x00\x04' b'\x37\x39\x21\x50' \
4769
 
+            b'\x09\xab\xe8\xd2' b'\x16\x09\xff\xeb'
4770
 
 
4771
 
 
4772
 
     def testPackRequest0(self):
4773
 
-        bin = apply(request.CreatePixmap._request.to_binary, (), self.req_args_0)
4774
 
+        bin = request.CreatePixmap._request.to_binary(*(), **self.req_args_0)
4775
 
         try:
4776
 
             assert bin == self.req_bin_0
4777
 
         except AssertionError:
4778
 
@@ -2762,11 +2770,11 @@
4779
 
         self.req_args_0 = {
4780
 
             'pixmap': 213012851,
4781
 
             }
4782
 
-        self.req_bin_0 = '\x36\x00\x00\x02' '\x0c\xb2\x51\x73'
4783
 
+        self.req_bin_0 = b'\x36\x00\x00\x02' b'\x0c\xb2\x51\x73'
4784
 
 
4785
 
 
4786
 
     def testPackRequest0(self):
4787
 
-        bin = apply(request.FreePixmap._request.to_binary, (), self.req_args_0)
4788
 
+        bin = request.FreePixmap._request.to_binary(*(), **self.req_args_0)
4789
 
         try:
4790
 
             assert bin == self.req_bin_0
4791
 
         except AssertionError:
4792
 
@@ -2791,24 +2799,24 @@
4793
 
             'drawable': 456876463,
4794
 
             'attrs': {'dashes': 183, 'fill_rule': 0, 'clip_mask': 620422624, 'plane_mask': 1797423280, 'line_style': 1, 'tile': 77620460, 'arc_mode': 0, 'clip_y_origin': -7419, 'dash_offset': 62459, 'line_width': 50494, 'background': 44336037, 'clip_x_origin': -32045, 'join_style': 2, 'graphics_exposures': 0, 'font': 95118395, 'tile_stipple_y_origin': -17619, 'stipple': 631657813, 'fill_style': 0, 'cap_style': 0, 'subwindow_mode': 0, 'tile_stipple_x_origin': -12494, 'foreground': 2096879871, 'function': 10},
4795
 
             }
4796
 
-        self.req_bin_0 = '\x37\x00\x00\x1b' '\x3f\x38\x5c\x6a' \
4797
 
-            '\x1b\x3b\x61\xaf' '\x00\x7f\xff\xff' \
4798
 
-            '\x0a\x00\x00\x00' '\x6b\x22\x80\xb0' \
4799
 
-            '\x7c\xfb\xd8\xff' '\x02\xa4\x83\xa5' \
4800
 
-            '\xc5\x3e\x00\x00' '\x01\x00\x00\x00' \
4801
 
-            '\x00\x00\x00\x00' '\x02\x00\x00\x00' \
4802
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
4803
 
-            '\x04\xa0\x64\xec' '\x25\xa6\x55\x55' \
4804
 
-            '\xcf\x32\x00\x00' '\xbb\x2d\x00\x00' \
4805
 
-            '\x05\xab\x64\x3b' '\x00\x00\x00\x00' \
4806
 
-            '\x00\x00\x00\x00' '\x82\xd3\x00\x00' \
4807
 
-            '\xe3\x05\x00\x00' '\x24\xfa\xe5\xe0' \
4808
 
-            '\xf3\xfb\x00\x00' '\xb7\x00\x00\x00' \
4809
 
-            '\x00\x00\x00\x00'
4810
 
+        self.req_bin_0 = b'\x37\x00\x00\x1b' b'\x3f\x38\x5c\x6a' \
4811
 
+            b'\x1b\x3b\x61\xaf' b'\x00\x7f\xff\xff' \
4812
 
+            b'\x0a\x00\x00\x00' b'\x6b\x22\x80\xb0' \
4813
 
+            b'\x7c\xfb\xd8\xff' b'\x02\xa4\x83\xa5' \
4814
 
+            b'\xc5\x3e\x00\x00' b'\x01\x00\x00\x00' \
4815
 
+            b'\x00\x00\x00\x00' b'\x02\x00\x00\x00' \
4816
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
4817
 
+            b'\x04\xa0\x64\xec' b'\x25\xa6\x55\x55' \
4818
 
+            b'\xcf\x32\x00\x00' b'\xbb\x2d\x00\x00' \
4819
 
+            b'\x05\xab\x64\x3b' b'\x00\x00\x00\x00' \
4820
 
+            b'\x00\x00\x00\x00' b'\x82\xd3\x00\x00' \
4821
 
+            b'\xe3\x05\x00\x00' b'\x24\xfa\xe5\xe0' \
4822
 
+            b'\xf3\xfb\x00\x00' b'\xb7\x00\x00\x00' \
4823
 
+            b'\x00\x00\x00\x00'
4824
 
 
4825
 
 
4826
 
     def testPackRequest0(self):
4827
 
-        bin = apply(request.CreateGC._request.to_binary, (), self.req_args_0)
4828
 
+        bin = request.CreateGC._request.to_binary(*(), **self.req_args_0)
4829
 
         try:
4830
 
             assert bin == self.req_bin_0
4831
 
         except AssertionError:
4832
 
@@ -2832,23 +2840,23 @@
4833
 
             'attrs': {'dashes': 249, 'fill_rule': 1, 'clip_mask': 496525721, 'plane_mask': 1467281901, 'line_style': 2, 'tile': 1713935374, 'arc_mode': 0, 'clip_y_origin': -24572, 'dash_offset': 46636, 'line_width': 61036, 'background': 1598773587, 'clip_x_origin': -19725, 'join_style': 1, 'graphics_exposures': 0, 'font': 429323306, 'tile_stipple_y_origin': -11767, 'stipple': 1365263649, 'fill_style': 2, 'cap_style': 1, 'subwindow_mode': 1, 'tile_stipple_x_origin': -23501, 'foreground': 1272378077, 'function': 11},
4834
 
             'gc': 518903558,
4835
 
             }
4836
 
-        self.req_bin_0 = '\x38\x00\x00\x1a' '\x1e\xed\xd7\x06' \
4837
 
-            '\x00\x7f\xff\xff' '\x0b\x00\x00\x00' \
4838
 
-            '\x57\x74\xf1\xed' '\x4b\xd6\xf2\xdd' \
4839
 
-            '\x5f\x4b\x59\x53' '\xee\x6c\x00\x00' \
4840
 
-            '\x02\x00\x00\x00' '\x01\x00\x00\x00' \
4841
 
-            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
4842
 
-            '\x01\x00\x00\x00' '\x66\x28\x94\x0e' \
4843
 
-            '\x51\x60\x45\x21' '\xa4\x33\x00\x00' \
4844
 
-            '\xd2\x09\x00\x00' '\x19\x96\xf4\x2a' \
4845
 
-            '\x01\x00\x00\x00' '\x00\x00\x00\x00' \
4846
 
-            '\xb2\xf3\x00\x00' '\xa0\x04\x00\x00' \
4847
 
-            '\x1d\x98\x61\x99' '\xb6\x2c\x00\x00' \
4848
 
-            '\xf9\x00\x00\x00' '\x00\x00\x00\x00'
4849
 
+        self.req_bin_0 = b'\x38\x00\x00\x1a' b'\x1e\xed\xd7\x06' \
4850
 
+            b'\x00\x7f\xff\xff' b'\x0b\x00\x00\x00' \
4851
 
+            b'\x57\x74\xf1\xed' b'\x4b\xd6\xf2\xdd' \
4852
 
+            b'\x5f\x4b\x59\x53' b'\xee\x6c\x00\x00' \
4853
 
+            b'\x02\x00\x00\x00' b'\x01\x00\x00\x00' \
4854
 
+            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
4855
 
+            b'\x01\x00\x00\x00' b'\x66\x28\x94\x0e' \
4856
 
+            b'\x51\x60\x45\x21' b'\xa4\x33\x00\x00' \
4857
 
+            b'\xd2\x09\x00\x00' b'\x19\x96\xf4\x2a' \
4858
 
+            b'\x01\x00\x00\x00' b'\x00\x00\x00\x00' \
4859
 
+            b'\xb2\xf3\x00\x00' b'\xa0\x04\x00\x00' \
4860
 
+            b'\x1d\x98\x61\x99' b'\xb6\x2c\x00\x00' \
4861
 
+            b'\xf9\x00\x00\x00' b'\x00\x00\x00\x00'
4862
 
 
4863
 
 
4864
 
     def testPackRequest0(self):
4865
 
-        bin = apply(request.ChangeGC._request.to_binary, (), self.req_args_0)
4866
 
+        bin = request.ChangeGC._request.to_binary(*(), **self.req_args_0)
4867
 
         try:
4868
 
             assert bin == self.req_bin_0
4869
 
         except AssertionError:
4870
 
@@ -2873,12 +2881,12 @@
4871
 
             'src_gc': 1958847367,
4872
 
             'dst_gc': 1311353896,
4873
 
             }
4874
 
-        self.req_bin_0 = '\x39\x00\x00\x04' '\x74\xc1\xa3\x87' \
4875
 
-            '\x4e\x29\xac\x28' '\x3d\xfc\x5c\x92'
4876
 
+        self.req_bin_0 = b'\x39\x00\x00\x04' b'\x74\xc1\xa3\x87' \
4877
 
+            b'\x4e\x29\xac\x28' b'\x3d\xfc\x5c\x92'
4878
 
 
4879
 
 
4880
 
     def testPackRequest0(self):
4881
 
-        bin = apply(request.CopyGC._request.to_binary, (), self.req_args_0)
4882
 
+        bin = request.CopyGC._request.to_binary(*(), **self.req_args_0)
4883
 
         try:
4884
 
             assert bin == self.req_bin_0
4885
 
         except AssertionError:
4886
 
@@ -2903,13 +2911,13 @@
4887
 
             'dash_offset': 51693,
4888
 
             'gc': 1639787502,
4889
 
             }
4890
 
-        self.req_bin_0 = '\x3a\x00\x00\x06' '\x61\xbd\x2b\xee' \
4891
 
-            '\xc9\xed\x00\x09' '\xa9\xf1\x9e\xee' \
4892
 
-            '\xad\x9f\xb6\x8b' '\x8b\x00\x00\x00'
4893
 
+        self.req_bin_0 = b'\x3a\x00\x00\x06' b'\x61\xbd\x2b\xee' \
4894
 
+            b'\xc9\xed\x00\x09' b'\xa9\xf1\x9e\xee' \
4895
 
+            b'\xad\x9f\xb6\x8b' b'\x8b\x00\x00\x00'
4896
 
 
4897
 
 
4898
 
     def testPackRequest0(self):
4899
 
-        bin = apply(request.SetDashes._request.to_binary, (), self.req_args_0)
4900
 
+        bin = request.SetDashes._request.to_binary(*(), **self.req_args_0)
4901
 
         try:
4902
 
             assert bin == self.req_bin_0
4903
 
         except AssertionError:
4904
 
@@ -2936,10 +2944,10 @@
4905
 
             'y_origin': -16557,
4906
 
             'ordering': 3,
4907
 
             }
4908
 
-        self.req_bin_0 = '\x3b\x03\x00\x07' '\x41\xe7\x44\x74' \
4909
 
-            '\xa7\x18\xbf\x53' '\xc3\xba\xf4\x3f' \
4910
 
-            '\xb6\x51\xe7\xff' '\xc9\x22\x9e\xe7' \
4911
 
-            '\x1e\x66\x26\x9b'
4912
 
+        self.req_bin_0 = b'\x3b\x03\x00\x07' b'\x41\xe7\x44\x74' \
4913
 
+            b'\xa7\x18\xbf\x53' b'\xc3\xba\xf4\x3f' \
4914
 
+            b'\xb6\x51\xe7\xff' b'\xc9\x22\x9e\xe7' \
4915
 
+            b'\x1e\x66\x26\x9b'
4916
 
 
4917
 
         self.req_args_1 = {
4918
 
             'rectangles': [],
4919
 
@@ -2948,12 +2956,12 @@
4920
 
             'y_origin': -10293,
4921
 
             'ordering': 0,
4922
 
             }
4923
 
-        self.req_bin_1 = '\x3b\x00\x00\x03' '\x11\x60\x29\xbb' \
4924
 
-            '\x8b\x55\xd7\xcb'
4925
 
+        self.req_bin_1 = b'\x3b\x00\x00\x03' b'\x11\x60\x29\xbb' \
4926
 
+            b'\x8b\x55\xd7\xcb'
4927
 
 
4928
 
 
4929
 
     def testPackRequest0(self):
4930
 
-        bin = apply(request.SetClipRectangles._request.to_binary, (), self.req_args_0)
4931
 
+        bin = request.SetClipRectangles._request.to_binary(*(), **self.req_args_0)
4932
 
         try:
4933
 
             assert bin == self.req_bin_0
4934
 
         except AssertionError:
4935
 
@@ -2971,7 +2979,7 @@
4936
 
             raise AssertionError(args)
4937
 
 
4938
 
     def testPackRequest1(self):
4939
 
-        bin = apply(request.SetClipRectangles._request.to_binary, (), self.req_args_1)
4940
 
+        bin = request.SetClipRectangles._request.to_binary(*(), **self.req_args_1)
4941
 
         try:
4942
 
             assert bin == self.req_bin_1
4943
 
         except AssertionError:
4944
 
@@ -2994,11 +3002,11 @@
4945
 
         self.req_args_0 = {
4946
 
             'gc': 371787524,
4947
 
             }
4948
 
-        self.req_bin_0 = '\x3c\x00\x00\x02' '\x16\x29\x07\x04'
4949
 
+        self.req_bin_0 = b'\x3c\x00\x00\x02' b'\x16\x29\x07\x04'
4950
 
 
4951
 
 
4952
 
     def testPackRequest0(self):
4953
 
-        bin = apply(request.FreeGC._request.to_binary, (), self.req_args_0)
4954
 
+        bin = request.FreeGC._request.to_binary(*(), **self.req_args_0)
4955
 
         try:
4956
 
             assert bin == self.req_bin_0
4957
 
         except AssertionError:
4958
 
@@ -3026,12 +3034,12 @@
4959
 
             'x': -1843,
4960
 
             'y': -32148,
4961
 
             }
4962
 
-        self.req_bin_0 = '\x3d\x00\x00\x04' '\x4a\xbe\x68\xe1' \
4963
 
-            '\xf8\xcd\x82\x6c' '\xf9\x4d\xd2\x10'
4964
 
+        self.req_bin_0 = b'\x3d\x00\x00\x04' b'\x4a\xbe\x68\xe1' \
4965
 
+            b'\xf8\xcd\x82\x6c' b'\xf9\x4d\xd2\x10'
4966
 
 
4967
 
 
4968
 
     def testPackRequest0(self):
4969
 
-        bin = apply(request.ClearArea._request.to_binary, (), self.req_args_0)
4970
 
+        bin = request.ClearArea._request.to_binary(*(), **self.req_args_0)
4971
 
         try:
4972
 
             assert bin == self.req_bin_0
4973
 
         except AssertionError:
4974
 
@@ -3062,14 +3070,14 @@
4975
 
             'dst_x': -19068,
4976
 
             'dst_y': -4602,
4977
 
             }
4978
 
-        self.req_bin_0 = '\x3e\x00\x00\x07' '\x13\x2d\x11\x29' \
4979
 
-            '\x0f\x05\x83\xf1' '\x07\x83\xb2\x60' \
4980
 
-            '\x9c\x38\xdf\x4c' '\xb5\x84\xee\x06' \
4981
 
-            '\xc1\x06\xf0\x3e'
4982
 
+        self.req_bin_0 = b'\x3e\x00\x00\x07' b'\x13\x2d\x11\x29' \
4983
 
+            b'\x0f\x05\x83\xf1' b'\x07\x83\xb2\x60' \
4984
 
+            b'\x9c\x38\xdf\x4c' b'\xb5\x84\xee\x06' \
4985
 
+            b'\xc1\x06\xf0\x3e'
4986
 
 
4987
 
 
4988
 
     def testPackRequest0(self):
4989
 
-        bin = apply(request.CopyArea._request.to_binary, (), self.req_args_0)
4990
 
+        bin = request.CopyArea._request.to_binary(*(), **self.req_args_0)
4991
 
         try:
4992
 
             assert bin == self.req_bin_0
4993
 
         except AssertionError:
4994
 
@@ -3101,14 +3109,14 @@
4995
 
             'dst_x': -24940,
4996
 
             'dst_y': -13009,
4997
 
             }
4998
 
-        self.req_bin_0 = '\x3f\x00\x00\x08' '\x76\x88\x65\x19' \
4999
 
-            '\x7e\x6a\x2e\xa4' '\x4b\x78\x61\xdd' \
5000
 
-            '\xee\x42\xa8\x7f' '\x9e\x94\xcd\x2f' \
5001
 
-            '\xa1\x19\x83\xfb' '\x7a\x50\x0a\x28'
5002
 
+        self.req_bin_0 = b'\x3f\x00\x00\x08' b'\x76\x88\x65\x19' \
5003
 
+            b'\x7e\x6a\x2e\xa4' b'\x4b\x78\x61\xdd' \
5004
 
+            b'\xee\x42\xa8\x7f' b'\x9e\x94\xcd\x2f' \
5005
 
+            b'\xa1\x19\x83\xfb' b'\x7a\x50\x0a\x28'
5006
 
 
5007
 
 
5008
 
     def testPackRequest0(self):
5009
 
-        bin = apply(request.CopyPlane._request.to_binary, (), self.req_args_0)
5010
 
+        bin = request.CopyPlane._request.to_binary(*(), **self.req_args_0)
5011
 
         try:
5012
 
             assert bin == self.req_bin_0
5013
 
         except AssertionError:
5014
 
@@ -3134,13 +3142,13 @@
5015
 
             'drawable': 1008674,
5016
 
             'coord_mode': 1,
5017
 
             }
5018
 
-        self.req_bin_0 = '\x40\x01\x00\x06' '\x00\x0f\x64\x22' \
5019
 
-            '\x0c\x4b\x61\x09' '\xa8\x4f\xbe\xb6' \
5020
 
-            '\xbf\xaf\xcd\xce' '\xb3\x60\xcc\xb5'
5021
 
+        self.req_bin_0 = b'\x40\x01\x00\x06' b'\x00\x0f\x64\x22' \
5022
 
+            b'\x0c\x4b\x61\x09' b'\xa8\x4f\xbe\xb6' \
5023
 
+            b'\xbf\xaf\xcd\xce' b'\xb3\x60\xcc\xb5'
5024
 
 
5025
 
 
5026
 
     def testPackRequest0(self):
5027
 
-        bin = apply(request.PolyPoint._request.to_binary, (), self.req_args_0)
5028
 
+        bin = request.PolyPoint._request.to_binary(*(), **self.req_args_0)
5029
 
         try:
5030
 
             assert bin == self.req_bin_0
5031
 
         except AssertionError:
5032
 
@@ -3166,14 +3174,14 @@
5033
 
             'drawable': 1668889192,
5034
 
             'coord_mode': 1,
5035
 
             }
5036
 
-        self.req_bin_0 = '\x41\x01\x00\x08' '\x63\x79\x3a\x68' \
5037
 
-            '\x50\xcc\xb9\xcd' '\xd2\x21\xb6\xa3' \
5038
 
-            '\xac\x83\xa7\x3e' '\xbb\x55\xca\x7d' \
5039
 
-            '\x98\x4f\xb4\x67' '\xd1\xfd\x98\x88'
5040
 
+        self.req_bin_0 = b'\x41\x01\x00\x08' b'\x63\x79\x3a\x68' \
5041
 
+            b'\x50\xcc\xb9\xcd' b'\xd2\x21\xb6\xa3' \
5042
 
+            b'\xac\x83\xa7\x3e' b'\xbb\x55\xca\x7d' \
5043
 
+            b'\x98\x4f\xb4\x67' b'\xd1\xfd\x98\x88'
5044
 
 
5045
 
 
5046
 
     def testPackRequest0(self):
5047
 
-        bin = apply(request.PolyLine._request.to_binary, (), self.req_args_0)
5048
 
+        bin = request.PolyLine._request.to_binary(*(), **self.req_args_0)
5049
 
         try:
5050
 
             assert bin == self.req_bin_0
5051
 
         except AssertionError:
5052
 
@@ -3198,13 +3206,13 @@
5053
 
             'drawable': 146511635,
5054
 
             'gc': 53385255,
5055
 
             }
5056
 
-        self.req_bin_0 = '\x42\x00\x00\x05' '\x08\xbb\x97\x13' \
5057
 
-            '\x03\x2e\x98\x27' '\xce\xbe\xa1\x44' \
5058
 
-            '\x9b\x56\xa8\x05'
5059
 
+        self.req_bin_0 = b'\x42\x00\x00\x05' b'\x08\xbb\x97\x13' \
5060
 
+            b'\x03\x2e\x98\x27' b'\xce\xbe\xa1\x44' \
5061
 
+            b'\x9b\x56\xa8\x05'
5062
 
 
5063
 
 
5064
 
     def testPackRequest0(self):
5065
 
-        bin = apply(request.PolySegment._request.to_binary, (), self.req_args_0)
5066
 
+        bin = request.PolySegment._request.to_binary(*(), **self.req_args_0)
5067
 
         try:
5068
 
             assert bin == self.req_bin_0
5069
 
         except AssertionError:
5070
 
@@ -3229,15 +3237,15 @@
5071
 
             'gc': 410140275,
5072
 
             'rectangles': [{'height': 63567, 'x': -16992, 'width': 11122, 'y': -21320}, {'height': 34652, 'x': -18051, 'width': 59622, 'y': -30426}, {'height': 45646, 'x': -1111, 'width': 46231, 'y': -25261}],
5073
 
             }
5074
 
-        self.req_bin_0 = '\x43\x00\x00\x09' '\x72\xe3\x09\x3d' \
5075
 
-            '\x18\x72\x3e\x73' '\xbd\xa0\xac\xb8' \
5076
 
-            '\x2b\x72\xf8\x4f' '\xb9\x7d\x89\x26' \
5077
 
-            '\xe8\xe6\x87\x5c' '\xfb\xa9\x9d\x53' \
5078
 
-            '\xb4\x97\xb2\x4e'
5079
 
+        self.req_bin_0 = b'\x43\x00\x00\x09' b'\x72\xe3\x09\x3d' \
5080
 
+            b'\x18\x72\x3e\x73' b'\xbd\xa0\xac\xb8' \
5081
 
+            b'\x2b\x72\xf8\x4f' b'\xb9\x7d\x89\x26' \
5082
 
+            b'\xe8\xe6\x87\x5c' b'\xfb\xa9\x9d\x53' \
5083
 
+            b'\xb4\x97\xb2\x4e'
5084
 
 
5085
 
 
5086
 
     def testPackRequest0(self):
5087
 
-        bin = apply(request.PolyRectangle._request.to_binary, (), self.req_args_0)
5088
 
+        bin = request.PolyRectangle._request.to_binary(*(), **self.req_args_0)
5089
 
         try:
5090
 
             assert bin == self.req_bin_0
5091
 
         except AssertionError:
5092
 
@@ -3262,16 +3270,16 @@
5093
 
             'drawable': 718777148,
5094
 
             'gc': 1127021391,
5095
 
             }
5096
 
-        self.req_bin_0 = '\x44\x00\x00\x0c' '\x2a\xd7\xab\x3c' \
5097
 
-            '\x43\x2c\xfb\x4f' '\xec\xb1\xdc\x0b' \
5098
 
-            '\xff\xa8\x92\xad' '\xbd\xad\x9b\xce' \
5099
 
-            '\xc9\xd7\xa6\xb2' '\xf2\xdd\x24\x6a' \
5100
 
-            '\xae\xd3\xde\xce' '\xce\x6b\xe2\x82' \
5101
 
-            '\xf8\xf4\xf7\x22' '\xfb\x31\xfc\xd7'
5102
 
+        self.req_bin_0 = b'\x44\x00\x00\x0c' b'\x2a\xd7\xab\x3c' \
5103
 
+            b'\x43\x2c\xfb\x4f' b'\xec\xb1\xdc\x0b' \
5104
 
+            b'\xff\xa8\x92\xad' b'\xbd\xad\x9b\xce' \
5105
 
+            b'\xc9\xd7\xa6\xb2' b'\xf2\xdd\x24\x6a' \
5106
 
+            b'\xae\xd3\xde\xce' b'\xce\x6b\xe2\x82' \
5107
 
+            b'\xf8\xf4\xf7\x22' b'\xfb\x31\xfc\xd7'
5108
 
 
5109
 
 
5110
 
     def testPackRequest0(self):
5111
 
-        bin = apply(request.PolyArc._request.to_binary, (), self.req_args_0)
5112
 
+        bin = request.PolyArc._request.to_binary(*(), **self.req_args_0)
5113
 
         try:
5114
 
             assert bin == self.req_bin_0
5115
 
         except AssertionError:
5116
 
@@ -3298,14 +3306,14 @@
5117
 
             'drawable': 1326525185,
5118
 
             'coord_mode': 0,
5119
 
             }
5120
 
-        self.req_bin_0 = '\x45\x00\x00\x07' '\x4f\x11\x2b\x01' \
5121
 
-            '\x3f\xce\x79\x1a' '\x01\x00\x00\x00' \
5122
 
-            '\xb6\xc3\xb4\x29' '\xdd\x38\x96\xbc' \
5123
 
-            '\xcb\xe8\xdb\x0a'
5124
 
+        self.req_bin_0 = b'\x45\x00\x00\x07' b'\x4f\x11\x2b\x01' \
5125
 
+            b'\x3f\xce\x79\x1a' b'\x01\x00\x00\x00' \
5126
 
+            b'\xb6\xc3\xb4\x29' b'\xdd\x38\x96\xbc' \
5127
 
+            b'\xcb\xe8\xdb\x0a'
5128
 
 
5129
 
 
5130
 
     def testPackRequest0(self):
5131
 
-        bin = apply(request.FillPoly._request.to_binary, (), self.req_args_0)
5132
 
+        bin = request.FillPoly._request.to_binary(*(), **self.req_args_0)
5133
 
         try:
5134
 
             assert bin == self.req_bin_0
5135
 
         except AssertionError:
5136
 
@@ -3330,14 +3338,14 @@
5137
 
             'gc': 1965498255,
5138
 
             'rectangles': [{'height': 36920, 'x': -2965, 'width': 26437, 'y': -3568}, {'height': 44383, 'x': -18327, 'width': 37730, 'y': -26752}],
5139
 
             }
5140
 
-        self.req_bin_0 = '\x46\x00\x00\x07' '\x65\xd8\x42\xcc' \
5141
 
-            '\x75\x27\x1f\x8f' '\xf4\x6b\xf2\x10' \
5142
 
-            '\x67\x45\x90\x38' '\xb8\x69\x97\x80' \
5143
 
-            '\x93\x62\xad\x5f'
5144
 
+        self.req_bin_0 = b'\x46\x00\x00\x07' b'\x65\xd8\x42\xcc' \
5145
 
+            b'\x75\x27\x1f\x8f' b'\xf4\x6b\xf2\x10' \
5146
 
+            b'\x67\x45\x90\x38' b'\xb8\x69\x97\x80' \
5147
 
+            b'\x93\x62\xad\x5f'
5148
 
 
5149
 
 
5150
 
     def testPackRequest0(self):
5151
 
-        bin = apply(request.PolyFillRectangle._request.to_binary, (), self.req_args_0)
5152
 
+        bin = request.PolyFillRectangle._request.to_binary(*(), **self.req_args_0)
5153
 
         try:
5154
 
             assert bin == self.req_bin_0
5155
 
         except AssertionError:
5156
 
@@ -3362,13 +3370,13 @@
5157
 
             'drawable': 2083870696,
5158
 
             'gc': 414470877,
5159
 
             }
5160
 
-        self.req_bin_0 = '\x47\x00\x00\x06' '\x7c\x35\x57\xe8' \
5161
 
-            '\x18\xb4\x52\xdd' '\xd5\xfe\xb3\x9d' \
5162
 
-            '\xd2\x3b\xfa\x72' '\x91\x38\xe5\xc8'
5163
 
+        self.req_bin_0 = b'\x47\x00\x00\x06' b'\x7c\x35\x57\xe8' \
5164
 
+            b'\x18\xb4\x52\xdd' b'\xd5\xfe\xb3\x9d' \
5165
 
+            b'\xd2\x3b\xfa\x72' b'\x91\x38\xe5\xc8'
5166
 
 
5167
 
 
5168
 
     def testPackRequest0(self):
5169
 
-        bin = apply(request.PolyFillArc._request.to_binary, (), self.req_args_0)
5170
 
+        bin = request.PolyFillArc._request.to_binary(*(), **self.req_args_0)
5171
 
         try:
5172
 
             assert bin == self.req_bin_0
5173
 
         except AssertionError:
5174
 
@@ -3400,15 +3408,15 @@
5175
 
             'width': 62850,
5176
 
             'dst_y': -30693,
5177
 
             }
5178
 
-        self.req_bin_0 = '\x48\x01\x00\x09' '\x5b\x79\x56\xff' \
5179
 
-            '\x0c\x83\x06\x83' '\xf5\x82\x26\x9b' \
5180
 
-            '\xf3\x2c\x88\x1b' '\x93\xad\x00\x00' \
5181
 
-            '\x62\x69\x74\x20' '\x6d\x61\x70\x20' \
5182
 
-            '\x64\x61\x74\x61'
5183
 
+        self.req_bin_0 = b'\x48\x01\x00\x09' b'\x5b\x79\x56\xff' \
5184
 
+            b'\x0c\x83\x06\x83' b'\xf5\x82\x26\x9b' \
5185
 
+            b'\xf3\x2c\x88\x1b' b'\x93\xad\x00\x00' \
5186
 
+            b'\x62\x69\x74\x20' b'\x6d\x61\x70\x20' \
5187
 
+            b'\x64\x61\x74\x61'
5188
 
 
5189
 
 
5190
 
     def testPackRequest0(self):
5191
 
-        bin = apply(request.PutImage._request.to_binary, (), self.req_args_0)
5192
 
+        bin = request.PutImage._request.to_binary(*(), **self.req_args_0)
5193
 
         try:
5194
 
             assert bin == self.req_bin_0
5195
 
         except AssertionError:
5196
 
@@ -3437,9 +3445,9 @@
5197
 
             'format': 1,
5198
 
             'width': 58993,
5199
 
             }
5200
 
-        self.req_bin_0 = '\x49\x01\x00\x05' '\x4f\x3e\x5f\x83' \
5201
 
-            '\x93\xe8\x87\x75' '\xe6\x71\xa6\xa1' \
5202
 
-            '\x68\xae\xae\x00'
5203
 
+        self.req_bin_0 = b'\x49\x01\x00\x05' b'\x4f\x3e\x5f\x83' \
5204
 
+            b'\x93\xe8\x87\x75' b'\xe6\x71\xa6\xa1' \
5205
 
+            b'\x68\xae\xae\x00'
5206
 
 
5207
 
         self.reply_args_0 = {
5208
 
             'sequence_number': 54997,
5209
 
@@ -3447,18 +3455,18 @@
5210
 
             'visual': 1108632607,
5211
 
             'depth': 181,
5212
 
             }
5213
 
-        self.reply_bin_0 = '\x01\xb5\xd6\xd5' '\x00\x00\x00\x07' \
5214
 
-            '\x42\x14\x64\x1f' '\x00\x00\x00\x00' \
5215
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5216
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5217
 
-            '\x74\x68\x69\x73' '\x20\x69\x73\x20' \
5218
 
-            '\x72\x65\x61\x6c' '\x20\x6c\x79\x20' \
5219
 
-            '\x69\x6d\x61\x67' '\x20\x65\x20\x62' \
5220
 
-            '\x2d\x6d\x61\x70'
5221
 
+        self.reply_bin_0 = b'\x01\xb5\xd6\xd5' b'\x00\x00\x00\x07' \
5222
 
+            b'\x42\x14\x64\x1f' b'\x00\x00\x00\x00' \
5223
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5224
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5225
 
+            b'\x74\x68\x69\x73' b'\x20\x69\x73\x20' \
5226
 
+            b'\x72\x65\x61\x6c' b'\x20\x6c\x79\x20' \
5227
 
+            b'\x69\x6d\x61\x67' b'\x20\x65\x20\x62' \
5228
 
+            b'\x2d\x6d\x61\x70'
5229
 
 
5230
 
 
5231
 
     def testPackRequest0(self):
5232
 
-        bin = apply(request.GetImage._request.to_binary, (), self.req_args_0)
5233
 
+        bin = request.GetImage._request.to_binary(*(), **self.req_args_0)
5234
 
         try:
5235
 
             assert bin == self.req_bin_0
5236
 
         except AssertionError:
5237
 
@@ -3476,7 +3484,7 @@
5238
 
             raise AssertionError(args)
5239
 
 
5240
 
     def testPackReply0(self):
5241
 
-        bin = apply(request.GetImage._reply.to_binary, (), self.reply_args_0)
5242
 
+        bin = request.GetImage._reply.to_binary(*(), **self.reply_args_0)
5243
 
         try:
5244
 
             assert bin == self.reply_bin_0
5245
 
         except AssertionError:
5246
 
@@ -3503,14 +3511,14 @@
5247
 
             'items': [{'delta': 2, 'string': 'zoo'}, 16909060, {'delta': 0, 'string': 'ie'}],
5248
 
             'y': -8902,
5249
 
             }
5250
 
-        self.req_bin_0 = '\x4a\x00\x00\x08' '\x5c\x72\x5c\x8a' \
5251
 
-            '\x58\x4e\xe2\x69' '\xcb\x14\xdd\x3a' \
5252
 
-            '\x03\x02\x7a\x6f' '\x6f\xff\x01\x02' \
5253
 
-            '\x03\x04\x02\x00' '\x69\x65\x00\x00'
5254
 
+        self.req_bin_0 = b'\x4a\x00\x00\x08' b'\x5c\x72\x5c\x8a' \
5255
 
+            b'\x58\x4e\xe2\x69' b'\xcb\x14\xdd\x3a' \
5256
 
+            b'\x03\x02\x7a\x6f' b'\x6f\xff\x01\x02' \
5257
 
+            b'\x03\x04\x02\x00' b'\x69\x65\x00\x00'
5258
 
 
5259
 
 
5260
 
     def testPackRequest0(self):
5261
 
-        bin = apply(request.PolyText8._request.to_binary, (), self.req_args_0)
5262
 
+        bin = request.PolyText8._request.to_binary(*(), **self.req_args_0)
5263
 
         try:
5264
 
             assert bin == self.req_bin_0
5265
 
         except AssertionError:
5266
 
@@ -3537,14 +3545,14 @@
5267
 
             'items': [{'delta': 2, 'string': (4131, 18)}, 16909060],
5268
 
             'y': -2741,
5269
 
             }
5270
 
-        self.req_bin_0 = '\x4b\x00\x00\x07' '\x5e\xda\xf1\xf4' \
5271
 
-            '\x17\xe2\x28\x18' '\x84\x82\xf5\x4b' \
5272
 
-            '\x02\x02\x10\x23' '\x00\x12\xff\x01' \
5273
 
-            '\x02\x03\x04\x00'
5274
 
+        self.req_bin_0 = b'\x4b\x00\x00\x07' b'\x5e\xda\xf1\xf4' \
5275
 
+            b'\x17\xe2\x28\x18' b'\x84\x82\xf5\x4b' \
5276
 
+            b'\x02\x02\x10\x23' b'\x00\x12\xff\x01' \
5277
 
+            b'\x02\x03\x04\x00'
5278
 
 
5279
 
 
5280
 
     def testPackRequest0(self):
5281
 
-        bin = apply(request.PolyText16._request.to_binary, (), self.req_args_0)
5282
 
+        bin = request.PolyText16._request.to_binary(*(), **self.req_args_0)
5283
 
         try:
5284
 
             assert bin == self.req_bin_0
5285
 
         except AssertionError:
5286
 
@@ -3571,13 +3579,13 @@
5287
 
             'x': -16077,
5288
 
             'y': -4873,
5289
 
             }
5290
 
-        self.req_bin_0 = '\x4c\x06\x00\x06' '\x6c\xb1\xdd\x5d' \
5291
 
-            '\x53\x10\x80\x21' '\xc1\x33\xec\xf7' \
5292
 
-            '\x73\x68\x6f\x77' '\x6d\x65\x00\x00'
5293
 
+        self.req_bin_0 = b'\x4c\x06\x00\x06' b'\x6c\xb1\xdd\x5d' \
5294
 
+            b'\x53\x10\x80\x21' b'\xc1\x33\xec\xf7' \
5295
 
+            b'\x73\x68\x6f\x77' b'\x6d\x65\x00\x00'
5296
 
 
5297
 
 
5298
 
     def testPackRequest0(self):
5299
 
-        bin = apply(request.ImageText8._request.to_binary, (), self.req_args_0)
5300
 
+        bin = request.ImageText8._request.to_binary(*(), **self.req_args_0)
5301
 
         try:
5302
 
             assert bin == self.req_bin_0
5303
 
         except AssertionError:
5304
 
@@ -3604,14 +3612,14 @@
5305
 
             'x': -21343,
5306
 
             'y': -24237,
5307
 
             }
5308
 
-        self.req_bin_0 = '\x4d\x08\x00\x08' '\x02\x00\xce\x10' \
5309
 
-            '\x65\x77\x08\xde' '\xac\xa1\xa1\x53' \
5310
 
-            '\x00\x73\x00\x68' '\x00\x6f\x00\x77' \
5311
 
-            '\x00\x6d\x00\x6f' '\x00\x72\x00\x65'
5312
 
+        self.req_bin_0 = b'\x4d\x08\x00\x08' b'\x02\x00\xce\x10' \
5313
 
+            b'\x65\x77\x08\xde' b'\xac\xa1\xa1\x53' \
5314
 
+            b'\x00\x73\x00\x68' b'\x00\x6f\x00\x77' \
5315
 
+            b'\x00\x6d\x00\x6f' b'\x00\x72\x00\x65'
5316
 
 
5317
 
 
5318
 
     def testPackRequest0(self):
5319
 
-        bin = apply(request.ImageText16._request.to_binary, (), self.req_args_0)
5320
 
+        bin = request.ImageText16._request.to_binary(*(), **self.req_args_0)
5321
 
         try:
5322
 
             assert bin == self.req_bin_0
5323
 
         except AssertionError:
5324
 
@@ -3637,12 +3645,12 @@
5325
 
             'visual': 813982403,
5326
 
             'window': 698475631,
5327
 
             }
5328
 
-        self.req_bin_0 = '\x4e\x00\x00\x04' '\x09\x63\xd1\xab' \
5329
 
-            '\x29\xa1\xe4\x6f' '\x30\x84\x62\xc3'
5330
 
+        self.req_bin_0 = b'\x4e\x00\x00\x04' b'\x09\x63\xd1\xab' \
5331
 
+            b'\x29\xa1\xe4\x6f' b'\x30\x84\x62\xc3'
5332
 
 
5333
 
 
5334
 
     def testPackRequest0(self):
5335
 
-        bin = apply(request.CreateColormap._request.to_binary, (), self.req_args_0)
5336
 
+        bin = request.CreateColormap._request.to_binary(*(), **self.req_args_0)
5337
 
         try:
5338
 
             assert bin == self.req_bin_0
5339
 
         except AssertionError:
5340
 
@@ -3665,11 +3673,11 @@
5341
 
         self.req_args_0 = {
5342
 
             'cmap': 1296514923,
5343
 
             }
5344
 
-        self.req_bin_0 = '\x4f\x00\x00\x02' '\x4d\x47\x3f\x6b'
5345
 
+        self.req_bin_0 = b'\x4f\x00\x00\x02' b'\x4d\x47\x3f\x6b'
5346
 
 
5347
 
 
5348
 
     def testPackRequest0(self):
5349
 
-        bin = apply(request.FreeColormap._request.to_binary, (), self.req_args_0)
5350
 
+        bin = request.FreeColormap._request.to_binary(*(), **self.req_args_0)
5351
 
         try:
5352
 
             assert bin == self.req_bin_0
5353
 
         except AssertionError:
5354
 
@@ -3693,12 +3701,12 @@
5355
 
             'src_cmap': 1049336329,
5356
 
             'mid': 1237242690,
5357
 
             }
5358
 
-        self.req_bin_0 = '\x50\x00\x00\x03' '\x49\xbe\xd3\x42' \
5359
 
-            '\x3e\x8b\x9a\x09'
5360
 
+        self.req_bin_0 = b'\x50\x00\x00\x03' b'\x49\xbe\xd3\x42' \
5361
 
+            b'\x3e\x8b\x9a\x09'
5362
 
 
5363
 
 
5364
 
     def testPackRequest0(self):
5365
 
-        bin = apply(request.CopyColormapAndFree._request.to_binary, (), self.req_args_0)
5366
 
+        bin = request.CopyColormapAndFree._request.to_binary(*(), **self.req_args_0)
5367
 
         try:
5368
 
             assert bin == self.req_bin_0
5369
 
         except AssertionError:
5370
 
@@ -3721,11 +3729,11 @@
5371
 
         self.req_args_0 = {
5372
 
             'cmap': 1539075582,
5373
 
             }
5374
 
-        self.req_bin_0 = '\x51\x00\x00\x02' '\x5b\xbc\x6d\xfe'
5375
 
+        self.req_bin_0 = b'\x51\x00\x00\x02' b'\x5b\xbc\x6d\xfe'
5376
 
 
5377
 
 
5378
 
     def testPackRequest0(self):
5379
 
-        bin = apply(request.InstallColormap._request.to_binary, (), self.req_args_0)
5380
 
+        bin = request.InstallColormap._request.to_binary(*(), **self.req_args_0)
5381
 
         try:
5382
 
             assert bin == self.req_bin_0
5383
 
         except AssertionError:
5384
 
@@ -3748,11 +3756,11 @@
5385
 
         self.req_args_0 = {
5386
 
             'cmap': 959493342,
5387
 
             }
5388
 
-        self.req_bin_0 = '\x52\x00\x00\x02' '\x39\x30\xb4\xde'
5389
 
+        self.req_bin_0 = b'\x52\x00\x00\x02' b'\x39\x30\xb4\xde'
5390
 
 
5391
 
 
5392
 
     def testPackRequest0(self):
5393
 
-        bin = apply(request.UninstallColormap._request.to_binary, (), self.req_args_0)
5394
 
+        bin = request.UninstallColormap._request.to_binary(*(), **self.req_args_0)
5395
 
         try:
5396
 
             assert bin == self.req_bin_0
5397
 
         except AssertionError:
5398
 
@@ -3775,21 +3783,21 @@
5399
 
         self.req_args_0 = {
5400
 
             'window': 1517864638,
5401
 
             }
5402
 
-        self.req_bin_0 = '\x53\x00\x00\x02' '\x5a\x78\xc6\xbe'
5403
 
+        self.req_bin_0 = b'\x53\x00\x00\x02' b'\x5a\x78\xc6\xbe'
5404
 
 
5405
 
         self.reply_args_0 = {
5406
 
             'cmaps': [2146327722, 1361260227],
5407
 
             'sequence_number': 61652,
5408
 
             }
5409
 
-        self.reply_bin_0 = '\x01\x00\xf0\xd4' '\x00\x00\x00\x02' \
5410
 
-            '\x00\x02\x00\x00' '\x00\x00\x00\x00' \
5411
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5412
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5413
 
-            '\x7f\xee\x5c\xaa' '\x51\x23\x2e\xc3'
5414
 
+        self.reply_bin_0 = b'\x01\x00\xf0\xd4' b'\x00\x00\x00\x02' \
5415
 
+            b'\x00\x02\x00\x00' b'\x00\x00\x00\x00' \
5416
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5417
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5418
 
+            b'\x7f\xee\x5c\xaa' b'\x51\x23\x2e\xc3'
5419
 
 
5420
 
 
5421
 
     def testPackRequest0(self):
5422
 
-        bin = apply(request.ListInstalledColormaps._request.to_binary, (), self.req_args_0)
5423
 
+        bin = request.ListInstalledColormaps._request.to_binary(*(), **self.req_args_0)
5424
 
         try:
5425
 
             assert bin == self.req_bin_0
5426
 
         except AssertionError:
5427
 
@@ -3807,7 +3815,7 @@
5428
 
             raise AssertionError(args)
5429
 
 
5430
 
     def testPackReply0(self):
5431
 
-        bin = apply(request.ListInstalledColormaps._reply.to_binary, (), self.reply_args_0)
5432
 
+        bin = request.ListInstalledColormaps._reply.to_binary(*(), **self.reply_args_0)
5433
 
         try:
5434
 
             assert bin == self.reply_bin_0
5435
 
         except AssertionError:
5436
 
@@ -3833,8 +3841,8 @@
5437
 
             'cmap': 523356125,
5438
 
             'blue': 49580,
5439
 
             }
5440
 
-        self.req_bin_0 = '\x54\x00\x00\x04' '\x1f\x31\xc7\xdd' \
5441
 
-            '\x9b\x2d\xc2\xbe' '\xc1\xac\x00\x00'
5442
 
+        self.req_bin_0 = b'\x54\x00\x00\x04' b'\x1f\x31\xc7\xdd' \
5443
 
+            b'\x9b\x2d\xc2\xbe' b'\xc1\xac\x00\x00'
5444
 
 
5445
 
         self.reply_args_0 = {
5446
 
             'sequence_number': 10904,
5447
 
@@ -3843,14 +3851,14 @@
5448
 
             'pixel': 1067923656,
5449
 
             'blue': 14525,
5450
 
             }
5451
 
-        self.reply_bin_0 = '\x01\x00\x2a\x98' '\x00\x00\x00\x00' \
5452
 
-            '\xab\x08\x0c\x62' '\x38\xbd\x00\x00' \
5453
 
-            '\x3f\xa7\x38\xc8' '\x00\x00\x00\x00' \
5454
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
5455
 
+        self.reply_bin_0 = b'\x01\x00\x2a\x98' b'\x00\x00\x00\x00' \
5456
 
+            b'\xab\x08\x0c\x62' b'\x38\xbd\x00\x00' \
5457
 
+            b'\x3f\xa7\x38\xc8' b'\x00\x00\x00\x00' \
5458
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5459
 
 
5460
 
 
5461
 
     def testPackRequest0(self):
5462
 
-        bin = apply(request.AllocColor._request.to_binary, (), self.req_args_0)
5463
 
+        bin = request.AllocColor._request.to_binary(*(), **self.req_args_0)
5464
 
         try:
5465
 
             assert bin == self.req_bin_0
5466
 
         except AssertionError:
5467
 
@@ -3868,7 +3876,7 @@
5468
 
             raise AssertionError(args)
5469
 
 
5470
 
     def testPackReply0(self):
5471
 
-        bin = apply(request.AllocColor._reply.to_binary, (), self.reply_args_0)
5472
 
+        bin = request.AllocColor._reply.to_binary(*(), **self.reply_args_0)
5473
 
         try:
5474
 
             assert bin == self.reply_bin_0
5475
 
         except AssertionError:
5476
 
@@ -3892,9 +3900,9 @@
5477
 
             'cmap': 128217824,
5478
 
             'name': 'octarin',
5479
 
             }
5480
 
-        self.req_bin_0 = '\x55\x00\x00\x05' '\x07\xa4\x72\xe0' \
5481
 
-            '\x00\x07\x00\x00' '\x6f\x63\x74\x61' \
5482
 
-            '\x72\x69\x6e\x00'
5483
 
+        self.req_bin_0 = b'\x55\x00\x00\x05' b'\x07\xa4\x72\xe0' \
5484
 
+            b'\x00\x07\x00\x00' b'\x6f\x63\x74\x61' \
5485
 
+            b'\x72\x69\x6e\x00'
5486
 
 
5487
 
         self.reply_args_0 = {
5488
 
             'sequence_number': 19971,
5489
 
@@ -3906,14 +3914,14 @@
5490
 
             'screen_blue': 43109,
5491
 
             'exact_red': 64213,
5492
 
             }
5493
 
-        self.reply_bin_0 = '\x01\x00\x4e\x03' '\x00\x00\x00\x00' \
5494
 
-            '\x4e\xee\x49\x76' '\xfa\xd5\x71\x8b' \
5495
 
-            '\xe5\xbb\x82\x63' '\xc5\x43\xa8\x65' \
5496
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
5497
 
+        self.reply_bin_0 = b'\x01\x00\x4e\x03' b'\x00\x00\x00\x00' \
5498
 
+            b'\x4e\xee\x49\x76' b'\xfa\xd5\x71\x8b' \
5499
 
+            b'\xe5\xbb\x82\x63' b'\xc5\x43\xa8\x65' \
5500
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5501
 
 
5502
 
 
5503
 
     def testPackRequest0(self):
5504
 
-        bin = apply(request.AllocNamedColor._request.to_binary, (), self.req_args_0)
5505
 
+        bin = request.AllocNamedColor._request.to_binary(*(), **self.req_args_0)
5506
 
         try:
5507
 
             assert bin == self.req_bin_0
5508
 
         except AssertionError:
5509
 
@@ -3931,7 +3939,7 @@
5510
 
             raise AssertionError(args)
5511
 
 
5512
 
     def testPackReply0(self):
5513
 
-        bin = apply(request.AllocNamedColor._reply.to_binary, (), self.reply_args_0)
5514
 
+        bin = request.AllocNamedColor._reply.to_binary(*(), **self.reply_args_0)
5515
 
         try:
5516
 
             assert bin == self.reply_bin_0
5517
 
         except AssertionError:
5518
 
@@ -3957,42 +3965,42 @@
5519
 
             'cmap': 675372338,
5520
 
             'contiguous': 1,
5521
 
             }
5522
 
-        self.req_bin_0 = '\x56\x01\x00\x03' '\x28\x41\x5d\x32' \
5523
 
-            '\xe5\x4a\x80\x63'
5524
 
+        self.req_bin_0 = b'\x56\x01\x00\x03' b'\x28\x41\x5d\x32' \
5525
 
+            b'\xe5\x4a\x80\x63'
5526
 
 
5527
 
         self.reply_args_0 = {
5528
 
             'masks': [733927381, 1023311668, 595898647],
5529
 
             'pixels': [693075497, 1294879029, 1478712895, 1781963728, 1442185575, 1654003869, 787619123, 1049825849, 1773935772, 1689075922, 1626562257, 177731275, 661046122, 1970509470, 1918486395, 688539096, 41044851],
5530
 
             'sequence_number': 54025,
5531
 
             }
5532
 
-        self.reply_bin_0 = '\x01\x00\xd3\x09' '\x00\x00\x00\x14' \
5533
 
-            '\x00\x11\x00\x03' '\x00\x00\x00\x00' \
5534
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5535
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5536
 
-            '\x29\x4f\x7e\x29' '\x4d\x2e\x49\x35' \
5537
 
-            '\x58\x23\x5e\x3f' '\x6a\x36\x9b\xd0' \
5538
 
-            '\x55\xf6\x01\x67' '\x62\x96\x18\x9d' \
5539
 
-            '\x2e\xf2\x1d\x33' '\x3e\x93\x12\x39' \
5540
 
-            '\x69\xbc\x1c\x9c' '\x64\xad\x40\xd2' \
5541
 
-            '\x60\xf3\x5e\xd1' '\x0a\x97\xf6\xcb' \
5542
 
-            '\x27\x66\xc3\x6a' '\x75\x73\x96\x9e' \
5543
 
-            '\x72\x59\xc7\x7b' '\x29\x0a\x45\xd8' \
5544
 
-            '\x02\x72\x4b\x73' '\x2b\xbe\xd7\xd5' \
5545
 
-            '\x3c\xfe\x7f\x34' '\x23\x84\xb1\x17'
5546
 
+        self.reply_bin_0 = b'\x01\x00\xd3\x09' b'\x00\x00\x00\x14' \
5547
 
+            b'\x00\x11\x00\x03' b'\x00\x00\x00\x00' \
5548
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5549
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5550
 
+            b'\x29\x4f\x7e\x29' b'\x4d\x2e\x49\x35' \
5551
 
+            b'\x58\x23\x5e\x3f' b'\x6a\x36\x9b\xd0' \
5552
 
+            b'\x55\xf6\x01\x67' b'\x62\x96\x18\x9d' \
5553
 
+            b'\x2e\xf2\x1d\x33' b'\x3e\x93\x12\x39' \
5554
 
+            b'\x69\xbc\x1c\x9c' b'\x64\xad\x40\xd2' \
5555
 
+            b'\x60\xf3\x5e\xd1' b'\x0a\x97\xf6\xcb' \
5556
 
+            b'\x27\x66\xc3\x6a' b'\x75\x73\x96\x9e' \
5557
 
+            b'\x72\x59\xc7\x7b' b'\x29\x0a\x45\xd8' \
5558
 
+            b'\x02\x72\x4b\x73' b'\x2b\xbe\xd7\xd5' \
5559
 
+            b'\x3c\xfe\x7f\x34' b'\x23\x84\xb1\x17'
5560
 
 
5561
 
         self.reply_args_1 = {
5562
 
             'masks': [],
5563
 
             'pixels': [],
5564
 
             'sequence_number': 6273,
5565
 
             }
5566
 
-        self.reply_bin_1 = '\x01\x00\x18\x81' '\x00\x00\x00\x00' \
5567
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5568
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5569
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
5570
 
+        self.reply_bin_1 = b'\x01\x00\x18\x81' b'\x00\x00\x00\x00' \
5571
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5572
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5573
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5574
 
 
5575
 
 
5576
 
     def testPackRequest0(self):
5577
 
-        bin = apply(request.AllocColorCells._request.to_binary, (), self.req_args_0)
5578
 
+        bin = request.AllocColorCells._request.to_binary(*(), **self.req_args_0)
5579
 
         try:
5580
 
             assert bin == self.req_bin_0
5581
 
         except AssertionError:
5582
 
@@ -4010,7 +4018,7 @@
5583
 
             raise AssertionError(args)
5584
 
 
5585
 
     def testPackReply0(self):
5586
 
-        bin = apply(request.AllocColorCells._reply.to_binary, (), self.reply_args_0)
5587
 
+        bin = request.AllocColorCells._reply.to_binary(*(), **self.reply_args_0)
5588
 
         try:
5589
 
             assert bin == self.reply_bin_0
5590
 
         except AssertionError:
5591
 
@@ -4028,7 +4036,7 @@
5592
 
             raise AssertionError(args)
5593
 
 
5594
 
     def testPackReply1(self):
5595
 
-        bin = apply(request.AllocColorCells._reply.to_binary, (), self.reply_args_1)
5596
 
+        bin = request.AllocColorCells._reply.to_binary(*(), **self.reply_args_1)
5597
 
         try:
5598
 
             assert bin == self.reply_bin_1
5599
 
         except AssertionError:
5600
 
@@ -4056,8 +4064,8 @@
5601
 
             'contiguous': 0,
5602
 
             'blue': 23880,
5603
 
             }
5604
 
-        self.req_bin_0 = '\x57\x00\x00\x04' '\x12\x5c\x02\x63' \
5605
 
-            '\xe3\xa3\x59\x5c' '\x24\xd1\x5d\x48'
5606
 
+        self.req_bin_0 = b'\x57\x00\x00\x04' b'\x12\x5c\x02\x63' \
5607
 
+            b'\xe3\xa3\x59\x5c' b'\x24\xd1\x5d\x48'
5608
 
 
5609
 
         self.reply_args_0 = {
5610
 
             'green_mask': 265888391,
5611
 
@@ -4066,16 +4074,16 @@
5612
 
             'blue_mask': 44676180,
5613
 
             'red_mask': 734623206,
5614
 
             }
5615
 
-        self.reply_bin_0 = '\x01\x00\x8d\x4f' '\x00\x00\x00\x04' \
5616
 
-            '\x00\x04\x00\x00' '\x2b\xc9\x75\xe6' \
5617
 
-            '\x0f\xd9\x22\x87' '\x02\xa9\xb4\x54' \
5618
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5619
 
-            '\x1d\x52\xbe\x09' '\x4d\x99\x83\xbe' \
5620
 
-            '\x5f\xa5\xda\xfd' '\x54\x90\x6c\x90'
5621
 
+        self.reply_bin_0 = b'\x01\x00\x8d\x4f' b'\x00\x00\x00\x04' \
5622
 
+            b'\x00\x04\x00\x00' b'\x2b\xc9\x75\xe6' \
5623
 
+            b'\x0f\xd9\x22\x87' b'\x02\xa9\xb4\x54' \
5624
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5625
 
+            b'\x1d\x52\xbe\x09' b'\x4d\x99\x83\xbe' \
5626
 
+            b'\x5f\xa5\xda\xfd' b'\x54\x90\x6c\x90'
5627
 
 
5628
 
 
5629
 
     def testPackRequest0(self):
5630
 
-        bin = apply(request.AllocColorPlanes._request.to_binary, (), self.req_args_0)
5631
 
+        bin = request.AllocColorPlanes._request.to_binary(*(), **self.req_args_0)
5632
 
         try:
5633
 
             assert bin == self.req_bin_0
5634
 
         except AssertionError:
5635
 
@@ -4093,7 +4101,7 @@
5636
 
             raise AssertionError(args)
5637
 
 
5638
 
     def testPackReply0(self):
5639
 
-        bin = apply(request.AllocColorPlanes._reply.to_binary, (), self.reply_args_0)
5640
 
+        bin = request.AllocColorPlanes._reply.to_binary(*(), **self.reply_args_0)
5641
 
         try:
5642
 
             assert bin == self.reply_bin_0
5643
 
         except AssertionError:
5644
 
@@ -4118,20 +4126,20 @@
5645
 
             'pixels': [61281082, 398475082, 1660604639, 1516738417, 1211104329, 105034864, 884930615, 902914796, 288637231, 2097165249, 1171127263, 1027274519, 806213035, 1485898709, 542709465, 169067149, 1230881159],
5646
 
             'plane_mask': 1204733200,
5647
 
             }
5648
 
-        self.req_bin_0 = '\x58\x00\x00\x14' '\x2b\x55\x43\xd8' \
5649
 
-            '\x47\xce\xc5\x10' '\x03\xa7\x13\x3a' \
5650
 
-            '\x17\xc0\x3f\x4a' '\x62\xfa\xd0\xdf' \
5651
 
-            '\x5a\x67\x97\x71' '\x48\x2f\xfc\x49' \
5652
 
-            '\x06\x42\xb4\x70' '\x34\xbe\xf8\x37' \
5653
 
-            '\x35\xd1\x62\xec' '\x11\x34\x41\x2f' \
5654
 
-            '\x7d\x00\x33\xc1' '\x45\xcd\xfb\xdf' \
5655
 
-            '\x3d\x3a\xf7\x17' '\x30\x0d\xd5\xab' \
5656
 
-            '\x58\x91\x03\xd5' '\x20\x59\x16\xd9' \
5657
 
-            '\x0a\x13\xc2\x8d' '\x49\x5d\xc1\x87'
5658
 
+        self.req_bin_0 = b'\x58\x00\x00\x14' b'\x2b\x55\x43\xd8' \
5659
 
+            b'\x47\xce\xc5\x10' b'\x03\xa7\x13\x3a' \
5660
 
+            b'\x17\xc0\x3f\x4a' b'\x62\xfa\xd0\xdf' \
5661
 
+            b'\x5a\x67\x97\x71' b'\x48\x2f\xfc\x49' \
5662
 
+            b'\x06\x42\xb4\x70' b'\x34\xbe\xf8\x37' \
5663
 
+            b'\x35\xd1\x62\xec' b'\x11\x34\x41\x2f' \
5664
 
+            b'\x7d\x00\x33\xc1' b'\x45\xcd\xfb\xdf' \
5665
 
+            b'\x3d\x3a\xf7\x17' b'\x30\x0d\xd5\xab' \
5666
 
+            b'\x58\x91\x03\xd5' b'\x20\x59\x16\xd9' \
5667
 
+            b'\x0a\x13\xc2\x8d' b'\x49\x5d\xc1\x87'
5668
 
 
5669
 
 
5670
 
     def testPackRequest0(self):
5671
 
-        bin = apply(request.FreeColors._request.to_binary, (), self.req_args_0)
5672
 
+        bin = request.FreeColors._request.to_binary(*(), **self.req_args_0)
5673
 
         try:
5674
 
             assert bin == self.req_bin_0
5675
 
         except AssertionError:
5676
 
@@ -4155,17 +4163,17 @@
5677
 
             'cmap': 501035281,
5678
 
             'items': [{'red': 27925, 'pixel': 1094971765, 'green': 3673, 'flags': 189, 'blue': 31593}, {'red': 41633, 'pixel': 1330003189, 'green': 56186, 'flags': 178, 'blue': 30263}, {'red': 36007, 'pixel': 1813524037, 'green': 29697, 'flags': 224, 'blue': 14071}, {'red': 45716, 'pixel': 1987610486, 'green': 55405, 'flags': 200, 'blue': 35734}],
5679
 
             }
5680
 
-        self.req_bin_0 = '\x59\x00\x00\x0e' '\x1d\xdd\x31\x11' \
5681
 
-            '\x41\x43\xf1\x75' '\x6d\x15\x0e\x59' \
5682
 
-            '\x7b\x69\xbd\x00' '\x4f\x46\x3c\xf5' \
5683
 
-            '\xa2\xa1\xdb\x7a' '\x76\x37\xb2\x00' \
5684
 
-            '\x6c\x18\x2e\x45' '\x8c\xa7\x74\x01' \
5685
 
-            '\x36\xf7\xe0\x00' '\x76\x78\x87\x76' \
5686
 
-            '\xb2\x94\xd8\x6d' '\x8b\x96\xc8\x00'
5687
 
+        self.req_bin_0 = b'\x59\x00\x00\x0e' b'\x1d\xdd\x31\x11' \
5688
 
+            b'\x41\x43\xf1\x75' b'\x6d\x15\x0e\x59' \
5689
 
+            b'\x7b\x69\xbd\x00' b'\x4f\x46\x3c\xf5' \
5690
 
+            b'\xa2\xa1\xdb\x7a' b'\x76\x37\xb2\x00' \
5691
 
+            b'\x6c\x18\x2e\x45' b'\x8c\xa7\x74\x01' \
5692
 
+            b'\x36\xf7\xe0\x00' b'\x76\x78\x87\x76' \
5693
 
+            b'\xb2\x94\xd8\x6d' b'\x8b\x96\xc8\x00'
5694
 
 
5695
 
 
5696
 
     def testPackRequest0(self):
5697
 
-        bin = apply(request.StoreColors._request.to_binary, (), self.req_args_0)
5698
 
+        bin = request.StoreColors._request.to_binary(*(), **self.req_args_0)
5699
 
         try:
5700
 
             assert bin == self.req_bin_0
5701
 
         except AssertionError:
5702
 
@@ -4191,13 +4199,13 @@
5703
 
             'cmap': 2061119590,
5704
 
             'pixel': 1846011298,
5705
 
             }
5706
 
-        self.req_bin_0 = '\x5a\xba\x00\x05' '\x7a\xda\x30\x66' \
5707
 
-            '\x6e\x07\xe5\xa2' '\x00\x04\x00\x00' \
5708
 
-            '\x62\x6c\x75\x65'
5709
 
+        self.req_bin_0 = b'\x5a\xba\x00\x05' b'\x7a\xda\x30\x66' \
5710
 
+            b'\x6e\x07\xe5\xa2' b'\x00\x04\x00\x00' \
5711
 
+            b'\x62\x6c\x75\x65'
5712
 
 
5713
 
 
5714
 
     def testPackRequest0(self):
5715
 
-        bin = apply(request.StoreNamedColor._request.to_binary, (), self.req_args_0)
5716
 
+        bin = request.StoreNamedColor._request.to_binary(*(), **self.req_args_0)
5717
 
         try:
5718
 
             assert bin == self.req_bin_0
5719
 
         except AssertionError:
5720
 
@@ -4221,35 +4229,35 @@
5721
 
             'cmap': 596369797,
5722
 
             'pixels': [1018587496, 1553480933, 952694607, 341816269, 306591348, 1178729919, 173027853, 875811363],
5723
 
             }
5724
 
-        self.req_bin_0 = '\x5b\x00\x00\x0a' '\x23\x8b\xe1\x85' \
5725
 
-            '\x3c\xb6\x69\x68' '\x5c\x98\x3c\xe5' \
5726
 
-            '\x38\xc8\xf7\x4f' '\x14\x5f\xb3\xcd' \
5727
 
-            '\x12\x46\x36\x74' '\x46\x41\xfd\xbf' \
5728
 
-            '\x0a\x50\x32\x0d' '\x34\x33\xd2\x23'
5729
 
+        self.req_bin_0 = b'\x5b\x00\x00\x0a' b'\x23\x8b\xe1\x85' \
5730
 
+            b'\x3c\xb6\x69\x68' b'\x5c\x98\x3c\xe5' \
5731
 
+            b'\x38\xc8\xf7\x4f' b'\x14\x5f\xb3\xcd' \
5732
 
+            b'\x12\x46\x36\x74' b'\x46\x41\xfd\xbf' \
5733
 
+            b'\x0a\x50\x32\x0d' b'\x34\x33\xd2\x23'
5734
 
 
5735
 
         self.reply_args_0 = {
5736
 
             'colors': [{'red': 6715, 'blue': 40144, 'green': 56664}, {'red': 5799, 'blue': 22078, 'green': 35523}, {'red': 60111, 'blue': 58654, 'green': 25206}, {'red': 7433, 'blue': 60908, 'green': 14468}, {'red': 31213, 'blue': 9298, 'green': 27481}],
5737
 
             'sequence_number': 60323,
5738
 
             }
5739
 
-        self.reply_bin_0 = '\x01\x00\xeb\xa3' '\x00\x00\x00\x0a' \
5740
 
-            '\x00\x05\x00\x00' '\x00\x00\x00\x00' \
5741
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5742
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5743
 
-            '\x1a\x3b\xdd\x58' '\x9c\xd0\x00\x00' \
5744
 
-            '\x16\xa7\x8a\xc3' '\x56\x3e\x00\x00' \
5745
 
-            '\xea\xcf\x62\x76' '\xe5\x1e\x00\x00' \
5746
 
-            '\x1d\x09\x38\x84' '\xed\xec\x00\x00' \
5747
 
-            '\x79\xed\x6b\x59' '\x24\x52\x00\x00'
5748
 
+        self.reply_bin_0 = b'\x01\x00\xeb\xa3' b'\x00\x00\x00\x0a' \
5749
 
+            b'\x00\x05\x00\x00' b'\x00\x00\x00\x00' \
5750
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5751
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5752
 
+            b'\x1a\x3b\xdd\x58' b'\x9c\xd0\x00\x00' \
5753
 
+            b'\x16\xa7\x8a\xc3' b'\x56\x3e\x00\x00' \
5754
 
+            b'\xea\xcf\x62\x76' b'\xe5\x1e\x00\x00' \
5755
 
+            b'\x1d\x09\x38\x84' b'\xed\xec\x00\x00' \
5756
 
+            b'\x79\xed\x6b\x59' b'\x24\x52\x00\x00'
5757
 
 
5758
 
         self.req_args_1 = {
5759
 
             'cmap': 79317049,
5760
 
             'pixels': [],
5761
 
             }
5762
 
-        self.req_bin_1 = '\x5b\x00\x00\x02' '\x04\xba\x48\x39'
5763
 
+        self.req_bin_1 = b'\x5b\x00\x00\x02' b'\x04\xba\x48\x39'
5764
 
 
5765
 
 
5766
 
     def testPackRequest0(self):
5767
 
-        bin = apply(request.QueryColors._request.to_binary, (), self.req_args_0)
5768
 
+        bin = request.QueryColors._request.to_binary(*(), **self.req_args_0)
5769
 
         try:
5770
 
             assert bin == self.req_bin_0
5771
 
         except AssertionError:
5772
 
@@ -4267,7 +4275,7 @@
5773
 
             raise AssertionError(args)
5774
 
 
5775
 
     def testPackRequest1(self):
5776
 
-        bin = apply(request.QueryColors._request.to_binary, (), self.req_args_1)
5777
 
+        bin = request.QueryColors._request.to_binary(*(), **self.req_args_1)
5778
 
         try:
5779
 
             assert bin == self.req_bin_1
5780
 
         except AssertionError:
5781
 
@@ -4285,7 +4293,7 @@
5782
 
             raise AssertionError(args)
5783
 
 
5784
 
     def testPackReply0(self):
5785
 
-        bin = apply(request.QueryColors._reply.to_binary, (), self.reply_args_0)
5786
 
+        bin = request.QueryColors._reply.to_binary(*(), **self.reply_args_0)
5787
 
         try:
5788
 
             assert bin == self.reply_bin_0
5789
 
         except AssertionError:
5790
 
@@ -4309,9 +4317,9 @@
5791
 
             'cmap': 789574750,
5792
 
             'name': 'octarin',
5793
 
             }
5794
 
-        self.req_bin_0 = '\x5c\x00\x00\x05' '\x2f\x0f\xf4\x5e' \
5795
 
-            '\x00\x07\x00\x00' '\x6f\x63\x74\x61' \
5796
 
-            '\x72\x69\x6e\x00'
5797
 
+        self.req_bin_0 = b'\x5c\x00\x00\x05' b'\x2f\x0f\xf4\x5e' \
5798
 
+            b'\x00\x07\x00\x00' b'\x6f\x63\x74\x61' \
5799
 
+            b'\x72\x69\x6e\x00'
5800
 
 
5801
 
         self.reply_args_0 = {
5802
 
             'sequence_number': 21040,
5803
 
@@ -4322,14 +4330,14 @@
5804
 
             'screen_blue': 29893,
5805
 
             'exact_red': 41875,
5806
 
             }
5807
 
-        self.reply_bin_0 = '\x01\x00\x52\x30' '\x00\x00\x00\x00' \
5808
 
-            '\xa3\x93\xe8\x9a' '\xf0\x48\xc7\x59' \
5809
 
-            '\xff\x22\x74\xc5' '\x00\x00\x00\x00' \
5810
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
5811
 
+        self.reply_bin_0 = b'\x01\x00\x52\x30' b'\x00\x00\x00\x00' \
5812
 
+            b'\xa3\x93\xe8\x9a' b'\xf0\x48\xc7\x59' \
5813
 
+            b'\xff\x22\x74\xc5' b'\x00\x00\x00\x00' \
5814
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5815
 
 
5816
 
 
5817
 
     def testPackRequest0(self):
5818
 
-        bin = apply(request.LookupColor._request.to_binary, (), self.req_args_0)
5819
 
+        bin = request.LookupColor._request.to_binary(*(), **self.req_args_0)
5820
 
         try:
5821
 
             assert bin == self.req_bin_0
5822
 
         except AssertionError:
5823
 
@@ -4347,7 +4355,7 @@
5824
 
             raise AssertionError(args)
5825
 
 
5826
 
     def testPackReply0(self):
5827
 
-        bin = apply(request.LookupColor._reply.to_binary, (), self.reply_args_0)
5828
 
+        bin = request.LookupColor._reply.to_binary(*(), **self.reply_args_0)
5829
 
         try:
5830
 
             assert bin == self.reply_bin_0
5831
 
         except AssertionError:
5832
 
@@ -4380,14 +4388,14 @@
5833
 
             'back_red': 31899,
5834
 
             'source': 794739749,
5835
 
             }
5836
 
-        self.req_bin_0 = '\x5d\x00\x00\x08' '\x78\x85\xb3\xb9' \
5837
 
-            '\x2f\x5e\xc4\x25' '\x19\x0b\x92\xe4' \
5838
 
-            '\xff\x2b\xa8\x14' '\xf8\x34\x7c\x9b' \
5839
 
-            '\x13\xe2\xc2\xd7' '\x37\x77\x80\x0c'
5840
 
+        self.req_bin_0 = b'\x5d\x00\x00\x08' b'\x78\x85\xb3\xb9' \
5841
 
+            b'\x2f\x5e\xc4\x25' b'\x19\x0b\x92\xe4' \
5842
 
+            b'\xff\x2b\xa8\x14' b'\xf8\x34\x7c\x9b' \
5843
 
+            b'\x13\xe2\xc2\xd7' b'\x37\x77\x80\x0c'
5844
 
 
5845
 
 
5846
 
     def testPackRequest0(self):
5847
 
-        bin = apply(request.CreateCursor._request.to_binary, (), self.req_args_0)
5848
 
+        bin = request.CreateCursor._request.to_binary(*(), **self.req_args_0)
5849
 
         try:
5850
 
             assert bin == self.req_bin_0
5851
 
         except AssertionError:
5852
 
@@ -4420,14 +4428,14 @@
5853
 
             'source': 1412345132,
5854
 
             'back_green': 52966,
5855
 
             }
5856
 
-        self.req_bin_0 = '\x5e\x00\x00\x08' '\x77\x2e\x8e\xfc' \
5857
 
-            '\x54\x2e\xad\x2c' '\x78\x51\x63\x27' \
5858
 
-            '\x1d\x90\xb4\x2c' '\xdb\xf2\x42\x5d' \
5859
 
-            '\x78\x49\xfb\xe4' '\xce\xe6\x19\x64'
5860
 
+        self.req_bin_0 = b'\x5e\x00\x00\x08' b'\x77\x2e\x8e\xfc' \
5861
 
+            b'\x54\x2e\xad\x2c' b'\x78\x51\x63\x27' \
5862
 
+            b'\x1d\x90\xb4\x2c' b'\xdb\xf2\x42\x5d' \
5863
 
+            b'\x78\x49\xfb\xe4' b'\xce\xe6\x19\x64'
5864
 
 
5865
 
 
5866
 
     def testPackRequest0(self):
5867
 
-        bin = apply(request.CreateGlyphCursor._request.to_binary, (), self.req_args_0)
5868
 
+        bin = request.CreateGlyphCursor._request.to_binary(*(), **self.req_args_0)
5869
 
         try:
5870
 
             assert bin == self.req_bin_0
5871
 
         except AssertionError:
5872
 
@@ -4450,11 +4458,11 @@
5873
 
         self.req_args_0 = {
5874
 
             'cursor': 553262138,
5875
 
             }
5876
 
-        self.req_bin_0 = '\x5f\x00\x00\x02' '\x20\xfa\x1c\x3a'
5877
 
+        self.req_bin_0 = b'\x5f\x00\x00\x02' b'\x20\xfa\x1c\x3a'
5878
 
 
5879
 
 
5880
 
     def testPackRequest0(self):
5881
 
-        bin = apply(request.FreeCursor._request.to_binary, (), self.req_args_0)
5882
 
+        bin = request.FreeCursor._request.to_binary(*(), **self.req_args_0)
5883
 
         try:
5884
 
             assert bin == self.req_bin_0
5885
 
         except AssertionError:
5886
 
@@ -4483,13 +4491,13 @@
5887
 
             'back_red': 64013,
5888
 
             'cursor': 295995276,
5889
 
             }
5890
 
-        self.req_bin_0 = '\x60\x00\x00\x05' '\x11\xa4\x87\x8c' \
5891
 
-            '\xae\xae\x81\x50' '\x43\x5e\xfa\x0d' \
5892
 
-            '\x2f\x83\xc1\x7d'
5893
 
+        self.req_bin_0 = b'\x60\x00\x00\x05' b'\x11\xa4\x87\x8c' \
5894
 
+            b'\xae\xae\x81\x50' b'\x43\x5e\xfa\x0d' \
5895
 
+            b'\x2f\x83\xc1\x7d'
5896
 
 
5897
 
 
5898
 
     def testPackRequest0(self):
5899
 
-        bin = apply(request.RecolorCursor._request.to_binary, (), self.req_args_0)
5900
 
+        bin = request.RecolorCursor._request.to_binary(*(), **self.req_args_0)
5901
 
         try:
5902
 
             assert bin == self.req_bin_0
5903
 
         except AssertionError:
5904
 
@@ -4515,22 +4523,22 @@
5905
 
             'item_class': 1,
5906
 
             'width': 27916,
5907
 
             }
5908
 
-        self.req_bin_0 = '\x61\x01\x00\x03' '\x1e\x02\xc1\x1e' \
5909
 
-            '\x6d\x0c\x87\xb7'
5910
 
+        self.req_bin_0 = b'\x61\x01\x00\x03' b'\x1e\x02\xc1\x1e' \
5911
 
+            b'\x6d\x0c\x87\xb7'
5912
 
 
5913
 
         self.reply_args_0 = {
5914
 
             'height': 60728,
5915
 
             'sequence_number': 34070,
5916
 
             'width': 35970,
5917
 
             }
5918
 
-        self.reply_bin_0 = '\x01\x00\x85\x16' '\x00\x00\x00\x00' \
5919
 
-            '\x8c\x82\xed\x38' '\x00\x00\x00\x00' \
5920
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5921
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
5922
 
+        self.reply_bin_0 = b'\x01\x00\x85\x16' b'\x00\x00\x00\x00' \
5923
 
+            b'\x8c\x82\xed\x38' b'\x00\x00\x00\x00' \
5924
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5925
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5926
 
 
5927
 
 
5928
 
     def testPackRequest0(self):
5929
 
-        bin = apply(request.QueryBestSize._request.to_binary, (), self.req_args_0)
5930
 
+        bin = request.QueryBestSize._request.to_binary(*(), **self.req_args_0)
5931
 
         try:
5932
 
             assert bin == self.req_bin_0
5933
 
         except AssertionError:
5934
 
@@ -4548,7 +4556,7 @@
5935
 
             raise AssertionError(args)
5936
 
 
5937
 
     def testPackReply0(self):
5938
 
-        bin = apply(request.QueryBestSize._reply.to_binary, (), self.reply_args_0)
5939
 
+        bin = request.QueryBestSize._reply.to_binary(*(), **self.reply_args_0)
5940
 
         try:
5941
 
             assert bin == self.reply_bin_0
5942
 
         except AssertionError:
5943
 
@@ -4571,8 +4579,8 @@
5944
 
         self.req_args_0 = {
5945
 
             'name': 'XTRA',
5946
 
             }
5947
 
-        self.req_bin_0 = '\x62\x00\x00\x03' '\x00\x04\x00\x00' \
5948
 
-            '\x58\x54\x52\x41'
5949
 
+        self.req_bin_0 = b'\x62\x00\x00\x03' b'\x00\x04\x00\x00' \
5950
 
+            b'\x58\x54\x52\x41'
5951
 
 
5952
 
         self.reply_args_0 = {
5953
 
             'sequence_number': 39952,
5954
 
@@ -4581,14 +4589,14 @@
5955
 
             'present': 1,
5956
 
             'first_event': 202,
5957
 
             }
5958
 
-        self.reply_bin_0 = '\x01\x00\x9c\x10' '\x00\x00\x00\x00' \
5959
 
-            '\x01\xc3\xca\x96' '\x00\x00\x00\x00' \
5960
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5961
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
5962
 
+        self.reply_bin_0 = b'\x01\x00\x9c\x10' b'\x00\x00\x00\x00' \
5963
 
+            b'\x01\xc3\xca\x96' b'\x00\x00\x00\x00' \
5964
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
5965
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
5966
 
 
5967
 
 
5968
 
     def testPackRequest0(self):
5969
 
-        bin = apply(request.QueryExtension._request.to_binary, (), self.req_args_0)
5970
 
+        bin = request.QueryExtension._request.to_binary(*(), **self.req_args_0)
5971
 
         try:
5972
 
             assert bin == self.req_bin_0
5973
 
         except AssertionError:
5974
 
@@ -4606,7 +4614,7 @@
5975
 
             raise AssertionError(args)
5976
 
 
5977
 
     def testPackReply0(self):
5978
 
-        bin = apply(request.QueryExtension._reply.to_binary, (), self.reply_args_0)
5979
 
+        bin = request.QueryExtension._reply.to_binary(*(), **self.reply_args_0)
5980
 
         try:
5981
 
             assert bin == self.reply_bin_0
5982
 
         except AssertionError:
5983
 
@@ -4628,22 +4636,22 @@
5984
 
     def setUp(self):
5985
 
         self.req_args_0 = {
5986
 
             }
5987
 
-        self.req_bin_0 = '\x63\x00\x00\x01'
5988
 
+        self.req_bin_0 = b'\x63\x00\x00\x01'
5989
 
 
5990
 
         self.reply_args_0 = {
5991
 
             'sequence_number': 20200,
5992
 
             'names': ['XTRA', 'XTRA-II'],
5993
 
             }
5994
 
-        self.reply_bin_0 = '\x01\x02\x4e\xe8' '\x00\x00\x00\x04' \
5995
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5996
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5997
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
5998
 
-            '\x04\x58\x54\x52' '\x41\x07\x58\x54' \
5999
 
-            '\x52\x41\x2d\x49' '\x49\x00\x00\x00'
6000
 
+        self.reply_bin_0 = b'\x01\x02\x4e\xe8' b'\x00\x00\x00\x04' \
6001
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6002
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6003
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6004
 
+            b'\x04\x58\x54\x52' b'\x41\x07\x58\x54' \
6005
 
+            b'\x52\x41\x2d\x49' b'\x49\x00\x00\x00'
6006
 
 
6007
 
 
6008
 
     def testPackRequest0(self):
6009
 
-        bin = apply(request.ListExtensions._request.to_binary, (), self.req_args_0)
6010
 
+        bin = request.ListExtensions._request.to_binary(*(), **self.req_args_0)
6011
 
         try:
6012
 
             assert bin == self.req_bin_0
6013
 
         except AssertionError:
6014
 
@@ -4661,7 +4669,7 @@
6015
 
             raise AssertionError(args)
6016
 
 
6017
 
     def testPackReply0(self):
6018
 
-        bin = apply(request.ListExtensions._reply.to_binary, (), self.reply_args_0)
6019
 
+        bin = request.ListExtensions._reply.to_binary(*(), **self.reply_args_0)
6020
 
         try:
6021
 
             assert bin == self.reply_bin_0
6022
 
         except AssertionError:
6023
 
@@ -4685,41 +4693,41 @@
6024
 
             'keysyms': [[707837223, 99294840, 1205405602], [67157514, 879853050, 2059131033], [1139736188, 578113249, 1525786315], [1335349176, 246731334, 277761436], [1386594542, 1676932187, 1862777168], [535892916, 342718655, 195574000], [5712156, 1820472637, 848853860], [1123197289, 1664064022, 94999154], [380150420, 402902535, 1061375041], [510686316, 502245882, 422893644], [1423643601, 194077695, 403885178], [1571826296, 529249772, 623556591], [720045879, 37553034, 955963792], [513407882, 861125615, 219940695], [184890179, 472466494, 1649347894], [1679171989, 1991748404, 1674460475], [1762342934, 276695222, 1941684480], [886658026, 1860690072, 577030090], [227169721, 1390318675, 321524615], [2144591365, 545119116, 404205206]],
6025
 
             'first_keycode': 250,
6026
 
             }
6027
 
-        self.req_bin_0 = '\x64\x14\x00\x3e' '\xfa\x03\x00\x00' \
6028
 
-            '\x2a\x30\xbd\x27' '\x05\xeb\x1e\x78' \
6029
 
-            '\x47\xd9\x07\xa2' '\x04\x00\xbe\x0a' \
6030
 
-            '\x34\x71\x7d\xfa' '\x7a\xbb\xd8\x99' \
6031
 
-            '\x43\xee\xfe\x7c' '\x22\x75\x4e\xe1' \
6032
 
-            '\x5a\xf1\xa6\xcb' '\x4f\x97\xcf\xb8' \
6033
 
-            '\x0e\xb4\xd2\x46' '\x10\x8e\x4d\x9c' \
6034
 
-            '\x52\xa5\xc0\xee' '\x63\xf3\xf4\x5b' \
6035
 
-            '\x6f\x07\xb9\x50' '\x1f\xf1\x13\xb4' \
6036
 
-            '\x14\x6d\x78\xbf' '\x0b\xa8\x38\xf0' \
6037
 
-            '\x00\x57\x29\x1c' '\x6c\x82\x35\x3d' \
6038
 
-            '\x32\x98\x7b\x64' '\x42\xf2\xa1\x69' \
6039
 
-            '\x63\x2f\x9a\x16' '\x05\xa9\x92\x72' \
6040
 
-            '\x16\xa8\xa2\x94' '\x18\x03\xce\x07' \
6041
 
-            '\x3f\x43\x4c\x41' '\x1e\x70\x74\x6c' \
6042
 
-            '\x1d\xef\xa9\xfa' '\x19\x34\xd8\x4c' \
6043
 
-            '\x54\xdb\x13\xd1' '\x0b\x91\x63\xff' \
6044
 
-            '\x18\x12\xcc\x7a' '\x5d\xb0\x2a\x78' \
6045
 
-            '\x1f\x8b\xb5\xec' '\x25\x2a\xb7\xef' \
6046
 
-            '\x2a\xeb\x07\x37' '\x02\x3d\x03\x8a' \
6047
 
-            '\x38\xfa\xd9\x90' '\x1e\x99\xfb\x8a' \
6048
 
-            '\x33\x53\xbb\xef' '\x0d\x1c\x07\x57' \
6049
 
-            '\x0b\x05\x33\x43' '\x1c\x29\x44\x3e' \
6050
 
-            '\x62\x4f\x0d\x36' '\x64\x16\x21\x95' \
6051
 
-            '\x76\xb7\xab\x34' '\x63\xce\x3d\x3b' \
6052
 
-            '\x69\x0b\x38\x16' '\x10\x7e\x08\xb6' \
6053
 
-            '\x73\xbb\xc1\x00' '\x34\xd9\x53\xea' \
6054
 
-            '\x6e\xe7\xe0\x98' '\x22\x64\xc7\xca' \
6055
 
-            '\x0d\x8a\x55\xb9' '\x52\xde\x94\x53' \
6056
 
-            '\x13\x2a\x13\x87' '\x7f\xd3\xde\x05' \
6057
 
-            '\x20\x7d\xdb\x8c' '\x18\x17\xae\x96'
6058
 
+        self.req_bin_0 = b'\x64\x14\x00\x3e' b'\xfa\x03\x00\x00' \
6059
 
+            b'\x2a\x30\xbd\x27' b'\x05\xeb\x1e\x78' \
6060
 
+            b'\x47\xd9\x07\xa2' b'\x04\x00\xbe\x0a' \
6061
 
+            b'\x34\x71\x7d\xfa' b'\x7a\xbb\xd8\x99' \
6062
 
+            b'\x43\xee\xfe\x7c' b'\x22\x75\x4e\xe1' \
6063
 
+            b'\x5a\xf1\xa6\xcb' b'\x4f\x97\xcf\xb8' \
6064
 
+            b'\x0e\xb4\xd2\x46' b'\x10\x8e\x4d\x9c' \
6065
 
+            b'\x52\xa5\xc0\xee' b'\x63\xf3\xf4\x5b' \
6066
 
+            b'\x6f\x07\xb9\x50' b'\x1f\xf1\x13\xb4' \
6067
 
+            b'\x14\x6d\x78\xbf' b'\x0b\xa8\x38\xf0' \
6068
 
+            b'\x00\x57\x29\x1c' b'\x6c\x82\x35\x3d' \
6069
 
+            b'\x32\x98\x7b\x64' b'\x42\xf2\xa1\x69' \
6070
 
+            b'\x63\x2f\x9a\x16' b'\x05\xa9\x92\x72' \
6071
 
+            b'\x16\xa8\xa2\x94' b'\x18\x03\xce\x07' \
6072
 
+            b'\x3f\x43\x4c\x41' b'\x1e\x70\x74\x6c' \
6073
 
+            b'\x1d\xef\xa9\xfa' b'\x19\x34\xd8\x4c' \
6074
 
+            b'\x54\xdb\x13\xd1' b'\x0b\x91\x63\xff' \
6075
 
+            b'\x18\x12\xcc\x7a' b'\x5d\xb0\x2a\x78' \
6076
 
+            b'\x1f\x8b\xb5\xec' b'\x25\x2a\xb7\xef' \
6077
 
+            b'\x2a\xeb\x07\x37' b'\x02\x3d\x03\x8a' \
6078
 
+            b'\x38\xfa\xd9\x90' b'\x1e\x99\xfb\x8a' \
6079
 
+            b'\x33\x53\xbb\xef' b'\x0d\x1c\x07\x57' \
6080
 
+            b'\x0b\x05\x33\x43' b'\x1c\x29\x44\x3e' \
6081
 
+            b'\x62\x4f\x0d\x36' b'\x64\x16\x21\x95' \
6082
 
+            b'\x76\xb7\xab\x34' b'\x63\xce\x3d\x3b' \
6083
 
+            b'\x69\x0b\x38\x16' b'\x10\x7e\x08\xb6' \
6084
 
+            b'\x73\xbb\xc1\x00' b'\x34\xd9\x53\xea' \
6085
 
+            b'\x6e\xe7\xe0\x98' b'\x22\x64\xc7\xca' \
6086
 
+            b'\x0d\x8a\x55\xb9' b'\x52\xde\x94\x53' \
6087
 
+            b'\x13\x2a\x13\x87' b'\x7f\xd3\xde\x05' \
6088
 
+            b'\x20\x7d\xdb\x8c' b'\x18\x17\xae\x96'
6089
 
 
6090
 
 
6091
 
     def testPackRequest0(self):
6092
 
-        bin = apply(request.ChangeKeyboardMapping._request.to_binary, (), self.req_args_0)
6093
 
+        bin = request.ChangeKeyboardMapping._request.to_binary(*(), **self.req_args_0)
6094
 
         try:
6095
 
             assert bin == self.req_bin_0
6096
 
         except AssertionError:
6097
 
@@ -4743,50 +4751,50 @@
6098
 
             'count': 131,
6099
 
             'first_keycode': 206,
6100
 
             }
6101
 
-        self.req_bin_0 = '\x65\x00\x00\x02' '\xce\x83\x00\x00'
6102
 
+        self.req_bin_0 = b'\x65\x00\x00\x02' b'\xce\x83\x00\x00'
6103
 
 
6104
 
         self.reply_args_0 = {
6105
 
             'keysyms': [[1550369014, 1683205347, 1879538861], [452613596, 1132022246, 357271408], [528724632, 2118423140, 640580111], [1981239140, 195173082, 497130901], [2001675011, 809172000, 1577756130], [739794769, 1774524806, 787951551], [1784021539, 1998872082, 1747812414], [396316053, 1525431160, 1808906812], [1676662850, 1222579650, 1205117622], [396026453, 1956747483, 1762026309], [1222502216, 1488139702, 1799119214], [1504675136, 1414564657, 419659384], [1934768917, 2095924224, 590955729], [582168798, 383228141, 1552516537], [1482483262, 1041896520, 1047041873], [1932705867, 292473490, 226147737], [780322016, 1965031752, 1481062205], [89811542, 1313413666, 686267194], [237776128, 1310737228, 792176733], [849034415, 1592538831, 837355505]],
6106
 
             'sequence_number': 61409,
6107
 
             }
6108
 
-        self.reply_bin_0 = '\x01\x03\xef\xe1' '\x00\x00\x00\x3c' \
6109
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6110
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6111
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6112
 
-            '\x5c\x68\xc0\xf6' '\x64\x53\xac\xe3' \
6113
 
-            '\x70\x07\x7c\xad' '\x1a\xfa\x55\xdc' \
6114
 
-            '\x43\x79\x49\xe6' '\x15\x4b\x87\x70' \
6115
 
-            '\x1f\x83\xb2\x98' '\x7e\x44\x92\x64' \
6116
 
-            '\x26\x2e\x7a\x0f' '\x76\x17\x4f\x64' \
6117
 
-            '\x0b\xa2\x1a\xda' '\x1d\xa1\x9d\x95' \
6118
 
-            '\x77\x4f\x23\x03' '\x30\x3a\xfc\x20' \
6119
 
-            '\x5e\x0a\xa5\xe2' '\x2c\x18\x5f\x51' \
6120
 
-            '\x69\xc5\x19\x86' '\x2e\xf7\x2f\xbf' \
6121
 
-            '\x6a\x56\x02\x23' '\x77\x24\x5e\x12' \
6122
 
-            '\x68\x2d\x80\x3e' '\x17\x9f\x4d\x95' \
6123
 
-            '\x5a\xec\x3b\x78' '\x6b\xd1\xba\x3c' \
6124
 
-            '\x63\xef\xd8\x42' '\x48\xdf\x15\xc2' \
6125
 
-            '\x47\xd4\xa2\xb6' '\x17\x9a\xe2\x55' \
6126
 
-            '\x74\xa1\x98\xdb' '\x69\x06\x63\x45' \
6127
 
-            '\x48\xdd\xe7\x48' '\x58\xb3\x35\xb6' \
6128
 
-            '\x6b\x3c\x61\x6e' '\x59\xaf\x85\x40' \
6129
 
-            '\x54\x50\x8b\x31' '\x19\x03\x7e\x78' \
6130
 
-            '\x73\x52\x3b\x15' '\x7c\xed\x44\x00' \
6131
 
-            '\x23\x39\x44\xd1' '\x22\xb3\x30\xde' \
6132
 
-            '\x16\xd7\x98\xed' '\x5c\x89\x85\xb9' \
6133
 
-            '\x58\x5c\xe6\x3e' '\x3e\x1a\x14\x48' \
6134
 
-            '\x3e\x68\x97\x51' '\x73\x32\xc0\x4b' \
6135
 
-            '\x11\x6e\xca\x92' '\x0d\x7a\xbd\x99' \
6136
 
-            '\x2e\x82\xc4\xe0' '\x75\x20\x01\x48' \
6137
 
-            '\x58\x47\x37\x3d' '\x05\x5a\x6a\x56' \
6138
 
-            '\x4e\x49\x1a\x22' '\x28\xe7\x9b\x3a' \
6139
 
-            '\x0e\x2c\x2d\x00' '\x4e\x20\x43\x4c' \
6140
 
-            '\x2f\x37\xa8\x5d' '\x32\x9b\x3c\xaf' \
6141
 
-            '\x5e\xec\x36\xcf' '\x31\xe9\x07\xf1'
6142
 
+        self.reply_bin_0 = b'\x01\x03\xef\xe1' b'\x00\x00\x00\x3c' \
6143
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6144
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6145
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6146
 
+            b'\x5c\x68\xc0\xf6' b'\x64\x53\xac\xe3' \
6147
 
+            b'\x70\x07\x7c\xad' b'\x1a\xfa\x55\xdc' \
6148
 
+            b'\x43\x79\x49\xe6' b'\x15\x4b\x87\x70' \
6149
 
+            b'\x1f\x83\xb2\x98' b'\x7e\x44\x92\x64' \
6150
 
+            b'\x26\x2e\x7a\x0f' b'\x76\x17\x4f\x64' \
6151
 
+            b'\x0b\xa2\x1a\xda' b'\x1d\xa1\x9d\x95' \
6152
 
+            b'\x77\x4f\x23\x03' b'\x30\x3a\xfc\x20' \
6153
 
+            b'\x5e\x0a\xa5\xe2' b'\x2c\x18\x5f\x51' \
6154
 
+            b'\x69\xc5\x19\x86' b'\x2e\xf7\x2f\xbf' \
6155
 
+            b'\x6a\x56\x02\x23' b'\x77\x24\x5e\x12' \
6156
 
+            b'\x68\x2d\x80\x3e' b'\x17\x9f\x4d\x95' \
6157
 
+            b'\x5a\xec\x3b\x78' b'\x6b\xd1\xba\x3c' \
6158
 
+            b'\x63\xef\xd8\x42' b'\x48\xdf\x15\xc2' \
6159
 
+            b'\x47\xd4\xa2\xb6' b'\x17\x9a\xe2\x55' \
6160
 
+            b'\x74\xa1\x98\xdb' b'\x69\x06\x63\x45' \
6161
 
+            b'\x48\xdd\xe7\x48' b'\x58\xb3\x35\xb6' \
6162
 
+            b'\x6b\x3c\x61\x6e' b'\x59\xaf\x85\x40' \
6163
 
+            b'\x54\x50\x8b\x31' b'\x19\x03\x7e\x78' \
6164
 
+            b'\x73\x52\x3b\x15' b'\x7c\xed\x44\x00' \
6165
 
+            b'\x23\x39\x44\xd1' b'\x22\xb3\x30\xde' \
6166
 
+            b'\x16\xd7\x98\xed' b'\x5c\x89\x85\xb9' \
6167
 
+            b'\x58\x5c\xe6\x3e' b'\x3e\x1a\x14\x48' \
6168
 
+            b'\x3e\x68\x97\x51' b'\x73\x32\xc0\x4b' \
6169
 
+            b'\x11\x6e\xca\x92' b'\x0d\x7a\xbd\x99' \
6170
 
+            b'\x2e\x82\xc4\xe0' b'\x75\x20\x01\x48' \
6171
 
+            b'\x58\x47\x37\x3d' b'\x05\x5a\x6a\x56' \
6172
 
+            b'\x4e\x49\x1a\x22' b'\x28\xe7\x9b\x3a' \
6173
 
+            b'\x0e\x2c\x2d\x00' b'\x4e\x20\x43\x4c' \
6174
 
+            b'\x2f\x37\xa8\x5d' b'\x32\x9b\x3c\xaf' \
6175
 
+            b'\x5e\xec\x36\xcf' b'\x31\xe9\x07\xf1'
6176
 
 
6177
 
 
6178
 
     def testPackRequest0(self):
6179
 
-        bin = apply(request.GetKeyboardMapping._request.to_binary, (), self.req_args_0)
6180
 
+        bin = request.GetKeyboardMapping._request.to_binary(*(), **self.req_args_0)
6181
 
         try:
6182
 
             assert bin == self.req_bin_0
6183
 
         except AssertionError:
6184
 
@@ -4804,7 +4812,7 @@
6185
 
             raise AssertionError(args)
6186
 
 
6187
 
     def testPackReply0(self):
6188
 
-        bin = apply(request.GetKeyboardMapping._reply.to_binary, (), self.reply_args_0)
6189
 
+        bin = request.GetKeyboardMapping._reply.to_binary(*(), **self.reply_args_0)
6190
 
         try:
6191
 
             assert bin == self.reply_bin_0
6192
 
         except AssertionError:
6193
 
@@ -4827,15 +4835,15 @@
6194
 
         self.req_args_0 = {
6195
 
             'attrs': {'key_click_percent': -35, 'bell_percent': -53, 'led_mode': 1, 'bell_pitch': -17390, 'auto_repeat_mode': 2, 'bell_duration': -30281, 'key': 235, 'led': 192},
6196
 
             }
6197
 
-        self.req_bin_0 = '\x66\x00\x00\x0a' '\x00\x00\x00\xff' \
6198
 
-            '\xdd\x00\x00\x00' '\xcb\x00\x00\x00' \
6199
 
-            '\xbc\x12\x00\x00' '\x89\xb7\x00\x00' \
6200
 
-            '\xc0\x00\x00\x00' '\x01\x00\x00\x00' \
6201
 
-            '\xeb\x00\x00\x00' '\x02\x00\x00\x00'
6202
 
+        self.req_bin_0 = b'\x66\x00\x00\x0a' b'\x00\x00\x00\xff' \
6203
 
+            b'\xdd\x00\x00\x00' b'\xcb\x00\x00\x00' \
6204
 
+            b'\xbc\x12\x00\x00' b'\x89\xb7\x00\x00' \
6205
 
+            b'\xc0\x00\x00\x00' b'\x01\x00\x00\x00' \
6206
 
+            b'\xeb\x00\x00\x00' b'\x02\x00\x00\x00'
6207
 
 
6208
 
 
6209
 
     def testPackRequest0(self):
6210
 
-        bin = apply(request.ChangeKeyboardControl._request.to_binary, (), self.req_args_0)
6211
 
+        bin = request.ChangeKeyboardControl._request.to_binary(*(), **self.req_args_0)
6212
 
         try:
6213
 
             assert bin == self.req_bin_0
6214
 
         except AssertionError:
6215
 
@@ -4857,7 +4865,7 @@
6216
 
     def setUp(self):
6217
 
         self.req_args_0 = {
6218
 
             }
6219
 
-        self.req_bin_0 = '\x67\x00\x00\x01'
6220
 
+        self.req_bin_0 = b'\x67\x00\x00\x01'
6221
 
 
6222
 
         self.reply_args_0 = {
6223
 
             'key_click_percent': 206,
6224
 
@@ -4869,17 +4877,17 @@
6225
 
             'led_mask': 438224369,
6226
 
             'bell_duration': 20235,
6227
 
             }
6228
 
-        self.reply_bin_0 = '\x01\x00\x75\xc5' '\x00\x00\x00\x05' \
6229
 
-            '\x1a\x1e\xc5\xf1' '\xce\xfb\x35\xd3' \
6230
 
-            '\x4f\x0b\x00\x00' '\xd9\xab\xa7\xa7' \
6231
 
-            '\xf3\xa3\x81\xef' '\xa8\x99\xe1\xc7' \
6232
 
-            '\xbd\x9b\xe4\x95' '\x94\xed\x8b\x96' \
6233
 
-            '\xd3\x85\x87\xfa' '\xbf\xa6\x92\xd4' \
6234
 
-            '\xef\xb7\xd6\xfa'
6235
 
+        self.reply_bin_0 = b'\x01\x00\x75\xc5' b'\x00\x00\x00\x05' \
6236
 
+            b'\x1a\x1e\xc5\xf1' b'\xce\xfb\x35\xd3' \
6237
 
+            b'\x4f\x0b\x00\x00' b'\xd9\xab\xa7\xa7' \
6238
 
+            b'\xf3\xa3\x81\xef' b'\xa8\x99\xe1\xc7' \
6239
 
+            b'\xbd\x9b\xe4\x95' b'\x94\xed\x8b\x96' \
6240
 
+            b'\xd3\x85\x87\xfa' b'\xbf\xa6\x92\xd4' \
6241
 
+            b'\xef\xb7\xd6\xfa'
6242
 
 
6243
 
 
6244
 
     def testPackRequest0(self):
6245
 
-        bin = apply(request.GetKeyboardControl._request.to_binary, (), self.req_args_0)
6246
 
+        bin = request.GetKeyboardControl._request.to_binary(*(), **self.req_args_0)
6247
 
         try:
6248
 
             assert bin == self.req_bin_0
6249
 
         except AssertionError:
6250
 
@@ -4897,7 +4905,7 @@
6251
 
             raise AssertionError(args)
6252
 
 
6253
 
     def testPackReply0(self):
6254
 
-        bin = apply(request.GetKeyboardControl._reply.to_binary, (), self.reply_args_0)
6255
 
+        bin = request.GetKeyboardControl._reply.to_binary(*(), **self.reply_args_0)
6256
 
         try:
6257
 
             assert bin == self.reply_bin_0
6258
 
         except AssertionError:
6259
 
@@ -4920,11 +4928,11 @@
6260
 
         self.req_args_0 = {
6261
 
             'percent': -19,
6262
 
             }
6263
 
-        self.req_bin_0 = '\x68\xed\x00\x01'
6264
 
+        self.req_bin_0 = b'\x68\xed\x00\x01'
6265
 
 
6266
 
 
6267
 
     def testPackRequest0(self):
6268
 
-        bin = apply(request.Bell._request.to_binary, (), self.req_args_0)
6269
 
+        bin = request.Bell._request.to_binary(*(), **self.req_args_0)
6270
 
         try:
6271
 
             assert bin == self.req_bin_0
6272
 
         except AssertionError:
6273
 
@@ -4951,12 +4959,12 @@
6274
 
             'do_thresh': 0,
6275
 
             'threshold': -8309,
6276
 
             }
6277
 
-        self.req_bin_0 = '\x69\x00\x00\x03' '\xdb\x7e\x81\x1c' \
6278
 
-            '\xdf\x8b\x00\x00'
6279
 
+        self.req_bin_0 = b'\x69\x00\x00\x03' b'\xdb\x7e\x81\x1c' \
6280
 
+            b'\xdf\x8b\x00\x00'
6281
 
 
6282
 
 
6283
 
     def testPackRequest0(self):
6284
 
-        bin = apply(request.ChangePointerControl._request.to_binary, (), self.req_args_0)
6285
 
+        bin = request.ChangePointerControl._request.to_binary(*(), **self.req_args_0)
6286
 
         try:
6287
 
             assert bin == self.req_bin_0
6288
 
         except AssertionError:
6289
 
@@ -4978,7 +4986,7 @@
6290
 
     def setUp(self):
6291
 
         self.req_args_0 = {
6292
 
             }
6293
 
-        self.req_bin_0 = '\x6a\x00\x00\x01'
6294
 
+        self.req_bin_0 = b'\x6a\x00\x00\x01'
6295
 
 
6296
 
         self.reply_args_0 = {
6297
 
             'accel_denom': 63793,
6298
 
@@ -4986,14 +4994,14 @@
6299
 
             'threshold': 46060,
6300
 
             'accel_num': 53419,
6301
 
             }
6302
 
-        self.reply_bin_0 = '\x01\x00\xea\x2a' '\x00\x00\x00\x00' \
6303
 
-            '\xd0\xab\xf9\x31' '\xb3\xec\x00\x00' \
6304
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6305
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
6306
 
+        self.reply_bin_0 = b'\x01\x00\xea\x2a' b'\x00\x00\x00\x00' \
6307
 
+            b'\xd0\xab\xf9\x31' b'\xb3\xec\x00\x00' \
6308
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6309
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
6310
 
 
6311
 
 
6312
 
     def testPackRequest0(self):
6313
 
-        bin = apply(request.GetPointerControl._request.to_binary, (), self.req_args_0)
6314
 
+        bin = request.GetPointerControl._request.to_binary(*(), **self.req_args_0)
6315
 
         try:
6316
 
             assert bin == self.req_bin_0
6317
 
         except AssertionError:
6318
 
@@ -5011,7 +5019,7 @@
6319
 
             raise AssertionError(args)
6320
 
 
6321
 
     def testPackReply0(self):
6322
 
-        bin = apply(request.GetPointerControl._reply.to_binary, (), self.reply_args_0)
6323
 
+        bin = request.GetPointerControl._reply.to_binary(*(), **self.reply_args_0)
6324
 
         try:
6325
 
             assert bin == self.reply_bin_0
6326
 
         except AssertionError:
6327
 
@@ -5037,12 +5045,12 @@
6328
 
             'interval': -12318,
6329
 
             'prefer_blank': 2,
6330
 
             }
6331
 
-        self.req_bin_0 = '\x6b\x00\x00\x03' '\xce\x7d\xcf\xe2' \
6332
 
-            '\x02\x00\x00\x00'
6333
 
+        self.req_bin_0 = b'\x6b\x00\x00\x03' b'\xce\x7d\xcf\xe2' \
6334
 
+            b'\x02\x00\x00\x00'
6335
 
 
6336
 
 
6337
 
     def testPackRequest0(self):
6338
 
-        bin = apply(request.SetScreenSaver._request.to_binary, (), self.req_args_0)
6339
 
+        bin = request.SetScreenSaver._request.to_binary(*(), **self.req_args_0)
6340
 
         try:
6341
 
             assert bin == self.req_bin_0
6342
 
         except AssertionError:
6343
 
@@ -5064,7 +5072,7 @@
6344
 
     def setUp(self):
6345
 
         self.req_args_0 = {
6346
 
             }
6347
 
-        self.req_bin_0 = '\x6c\x00\x00\x01'
6348
 
+        self.req_bin_0 = b'\x6c\x00\x00\x01'
6349
 
 
6350
 
         self.reply_args_0 = {
6351
 
             'allow_exposures': 1,
6352
 
@@ -5073,14 +5081,14 @@
6353
 
             'prefer_blanking': 1,
6354
 
             'interval': 60559,
6355
 
             }
6356
 
-        self.reply_bin_0 = '\x01\x00\x39\x52' '\x00\x00\x00\x00' \
6357
 
-            '\x07\x49\xec\x8f' '\x01\x01\x00\x00' \
6358
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6359
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
6360
 
+        self.reply_bin_0 = b'\x01\x00\x39\x52' b'\x00\x00\x00\x00' \
6361
 
+            b'\x07\x49\xec\x8f' b'\x01\x01\x00\x00' \
6362
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6363
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
6364
 
 
6365
 
 
6366
 
     def testPackRequest0(self):
6367
 
-        bin = apply(request.GetScreenSaver._request.to_binary, (), self.req_args_0)
6368
 
+        bin = request.GetScreenSaver._request.to_binary(*(), **self.req_args_0)
6369
 
         try:
6370
 
             assert bin == self.req_bin_0
6371
 
         except AssertionError:
6372
 
@@ -5098,7 +5106,7 @@
6373
 
             raise AssertionError(args)
6374
 
 
6375
 
     def testPackReply0(self):
6376
 
-        bin = apply(request.GetScreenSaver._reply.to_binary, (), self.reply_args_0)
6377
 
+        bin = request.GetScreenSaver._reply.to_binary(*(), **self.reply_args_0)
6378
 
         try:
6379
 
             assert bin == self.reply_bin_0
6380
 
         except AssertionError:
6381
 
@@ -5123,12 +5131,12 @@
6382
 
             'mode': 1,
6383
 
             'host_family': 1,
6384
 
             }
6385
 
-        self.req_bin_0 = '\x6d\x01\x00\x03' '\x01\x00\x00\x04' \
6386
 
-            '\xbc\xe2\x87\xc7'
6387
 
+        self.req_bin_0 = b'\x6d\x01\x00\x03' b'\x01\x00\x00\x04' \
6388
 
+            b'\xbc\xe2\x87\xc7'
6389
 
 
6390
 
 
6391
 
     def testPackRequest0(self):
6392
 
-        bin = apply(request.ChangeHosts._request.to_binary, (), self.req_args_0)
6393
 
+        bin = request.ChangeHosts._request.to_binary(*(), **self.req_args_0)
6394
 
         try:
6395
 
             assert bin == self.req_bin_0
6396
 
         except AssertionError:
6397
 
@@ -5150,23 +5158,23 @@
6398
 
     def setUp(self):
6399
 
         self.req_args_0 = {
6400
 
             }
6401
 
-        self.req_bin_0 = '\x6e\x00\x00\x01'
6402
 
+        self.req_bin_0 = b'\x6e\x00\x00\x01'
6403
 
 
6404
 
         self.reply_args_0 = {
6405
 
             'sequence_number': 31662,
6406
 
             'mode': 1,
6407
 
             'hosts': [{'family': 0, 'name': [34, 23, 178, 12]}, {'family': 0, 'name': [130, 236, 254, 15]}],
6408
 
             }
6409
 
-        self.reply_bin_0 = '\x01\x01\x7b\xae' '\x00\x00\x00\x04' \
6410
 
-            '\x00\x02\x00\x00' '\x00\x00\x00\x00' \
6411
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6412
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6413
 
-            '\x00\x00\x00\x04' '\x22\x17\xb2\x0c' \
6414
 
-            '\x00\x00\x00\x04' '\x82\xec\xfe\x0f'
6415
 
+        self.reply_bin_0 = b'\x01\x01\x7b\xae' b'\x00\x00\x00\x04' \
6416
 
+            b'\x00\x02\x00\x00' b'\x00\x00\x00\x00' \
6417
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6418
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6419
 
+            b'\x00\x00\x00\x04' b'\x22\x17\xb2\x0c' \
6420
 
+            b'\x00\x00\x00\x04' b'\x82\xec\xfe\x0f'
6421
 
 
6422
 
 
6423
 
     def testPackRequest0(self):
6424
 
-        bin = apply(request.ListHosts._request.to_binary, (), self.req_args_0)
6425
 
+        bin = request.ListHosts._request.to_binary(*(), **self.req_args_0)
6426
 
         try:
6427
 
             assert bin == self.req_bin_0
6428
 
         except AssertionError:
6429
 
@@ -5184,7 +5192,7 @@
6430
 
             raise AssertionError(args)
6431
 
 
6432
 
     def testPackReply0(self):
6433
 
-        bin = apply(request.ListHosts._reply.to_binary, (), self.reply_args_0)
6434
 
+        bin = request.ListHosts._reply.to_binary(*(), **self.reply_args_0)
6435
 
         try:
6436
 
             assert bin == self.reply_bin_0
6437
 
         except AssertionError:
6438
 
@@ -5207,11 +5215,11 @@
6439
 
         self.req_args_0 = {
6440
 
             'mode': 0,
6441
 
             }
6442
 
-        self.req_bin_0 = '\x6f\x00\x00\x01'
6443
 
+        self.req_bin_0 = b'\x6f\x00\x00\x01'
6444
 
 
6445
 
 
6446
 
     def testPackRequest0(self):
6447
 
-        bin = apply(request.SetAccessControl._request.to_binary, (), self.req_args_0)
6448
 
+        bin = request.SetAccessControl._request.to_binary(*(), **self.req_args_0)
6449
 
         try:
6450
 
             assert bin == self.req_bin_0
6451
 
         except AssertionError:
6452
 
@@ -5234,11 +5242,11 @@
6453
 
         self.req_args_0 = {
6454
 
             'mode': 0,
6455
 
             }
6456
 
-        self.req_bin_0 = '\x70\x00\x00\x01'
6457
 
+        self.req_bin_0 = b'\x70\x00\x00\x01'
6458
 
 
6459
 
 
6460
 
     def testPackRequest0(self):
6461
 
-        bin = apply(request.SetCloseDownMode._request.to_binary, (), self.req_args_0)
6462
 
+        bin = request.SetCloseDownMode._request.to_binary(*(), **self.req_args_0)
6463
 
         try:
6464
 
             assert bin == self.req_bin_0
6465
 
         except AssertionError:
6466
 
@@ -5261,11 +5269,11 @@
6467
 
         self.req_args_0 = {
6468
 
             'resource': 1679944210,
6469
 
             }
6470
 
-        self.req_bin_0 = '\x71\x00\x00\x02' '\x64\x21\xea\x12'
6471
 
+        self.req_bin_0 = b'\x71\x00\x00\x02' b'\x64\x21\xea\x12'
6472
 
 
6473
 
 
6474
 
     def testPackRequest0(self):
6475
 
-        bin = apply(request.KillClient._request.to_binary, (), self.req_args_0)
6476
 
+        bin = request.KillClient._request.to_binary(*(), **self.req_args_0)
6477
 
         try:
6478
 
             assert bin == self.req_bin_0
6479
 
         except AssertionError:
6480
 
@@ -5290,18 +5298,18 @@
6481
 
             'window': 109899869,
6482
 
             'properties': [1758270592, 1474783027, 1362037883, 19212066, 1095428186, 1435857629, 337040311, 1202859364, 1426187239, 725785004, 1722986690, 435243112],
6483
 
             }
6484
 
-        self.req_bin_0 = '\x72\x00\x00\x0f' '\x06\x8c\xf0\x5d' \
6485
 
-            '\x00\x0c\x96\x29' '\x68\xcd\x14\x80' \
6486
 
-            '\x57\xe7\x67\x33' '\x51\x2f\x0c\x7b' \
6487
 
-            '\x01\x25\x27\x22' '\x41\x4a\xe8\x5a' \
6488
 
-            '\x55\x95\x72\xdd' '\x14\x16\xd3\xb7' \
6489
 
-            '\x47\xb2\x2d\x64' '\x55\x01\xe3\xe7' \
6490
 
-            '\x2b\x42\x99\xac' '\x66\xb2\xb0\xc2' \
6491
 
-            '\x19\xf1\x48\x68'
6492
 
+        self.req_bin_0 = b'\x72\x00\x00\x0f' b'\x06\x8c\xf0\x5d' \
6493
 
+            b'\x00\x0c\x96\x29' b'\x68\xcd\x14\x80' \
6494
 
+            b'\x57\xe7\x67\x33' b'\x51\x2f\x0c\x7b' \
6495
 
+            b'\x01\x25\x27\x22' b'\x41\x4a\xe8\x5a' \
6496
 
+            b'\x55\x95\x72\xdd' b'\x14\x16\xd3\xb7' \
6497
 
+            b'\x47\xb2\x2d\x64' b'\x55\x01\xe3\xe7' \
6498
 
+            b'\x2b\x42\x99\xac' b'\x66\xb2\xb0\xc2' \
6499
 
+            b'\x19\xf1\x48\x68'
6500
 
 
6501
 
 
6502
 
     def testPackRequest0(self):
6503
 
-        bin = apply(request.RotateProperties._request.to_binary, (), self.req_args_0)
6504
 
+        bin = request.RotateProperties._request.to_binary(*(), **self.req_args_0)
6505
 
         try:
6506
 
             assert bin == self.req_bin_0
6507
 
         except AssertionError:
6508
 
@@ -5324,11 +5332,11 @@
6509
 
         self.req_args_0 = {
6510
 
             'mode': 1,
6511
 
             }
6512
 
-        self.req_bin_0 = '\x73\x01\x00\x01'
6513
 
+        self.req_bin_0 = b'\x73\x01\x00\x01'
6514
 
 
6515
 
 
6516
 
     def testPackRequest0(self):
6517
 
-        bin = apply(request.ForceScreenSaver._request.to_binary, (), self.req_args_0)
6518
 
+        bin = request.ForceScreenSaver._request.to_binary(*(), **self.req_args_0)
6519
 
         try:
6520
 
             assert bin == self.req_bin_0
6521
 
         except AssertionError:
6522
 
@@ -5351,21 +5359,21 @@
6523
 
         self.req_args_0 = {
6524
 
             'map': [218, 142, 195, 250, 194],
6525
 
             }
6526
 
-        self.req_bin_0 = '\x74\x05\x00\x03' '\xda\x8e\xc3\xfa' \
6527
 
-            '\xc2\x00\x00\x00'
6528
 
+        self.req_bin_0 = b'\x74\x05\x00\x03' b'\xda\x8e\xc3\xfa' \
6529
 
+            b'\xc2\x00\x00\x00'
6530
 
 
6531
 
         self.reply_args_0 = {
6532
 
             'sequence_number': 11995,
6533
 
             'status': 187,
6534
 
             }
6535
 
-        self.reply_bin_0 = '\x01\xbb\x2e\xdb' '\x00\x00\x00\x00' \
6536
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6537
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6538
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
6539
 
+        self.reply_bin_0 = b'\x01\xbb\x2e\xdb' b'\x00\x00\x00\x00' \
6540
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6541
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6542
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
6543
 
 
6544
 
 
6545
 
     def testPackRequest0(self):
6546
 
-        bin = apply(request.SetPointerMapping._request.to_binary, (), self.req_args_0)
6547
 
+        bin = request.SetPointerMapping._request.to_binary(*(), **self.req_args_0)
6548
 
         try:
6549
 
             assert bin == self.req_bin_0
6550
 
         except AssertionError:
6551
 
@@ -5383,7 +5391,7 @@
6552
 
             raise AssertionError(args)
6553
 
 
6554
 
     def testPackReply0(self):
6555
 
-        bin = apply(request.SetPointerMapping._reply.to_binary, (), self.reply_args_0)
6556
 
+        bin = request.SetPointerMapping._reply.to_binary(*(), **self.reply_args_0)
6557
 
         try:
6558
 
             assert bin == self.reply_bin_0
6559
 
         except AssertionError:
6560
 
@@ -5405,21 +5413,21 @@
6561
 
     def setUp(self):
6562
 
         self.req_args_0 = {
6563
 
             }
6564
 
-        self.req_bin_0 = '\x75\x00\x00\x01'
6565
 
+        self.req_bin_0 = b'\x75\x00\x00\x01'
6566
 
 
6567
 
         self.reply_args_0 = {
6568
 
             'sequence_number': 35825,
6569
 
             'map': [165, 233, 136, 197, 230],
6570
 
             }
6571
 
-        self.reply_bin_0 = '\x01\x05\x8b\xf1' '\x00\x00\x00\x02' \
6572
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6573
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6574
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6575
 
-            '\xa5\xe9\x88\xc5' '\xe6\x00\x00\x00'
6576
 
+        self.reply_bin_0 = b'\x01\x05\x8b\xf1' b'\x00\x00\x00\x02' \
6577
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6578
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6579
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6580
 
+            b'\xa5\xe9\x88\xc5' b'\xe6\x00\x00\x00'
6581
 
 
6582
 
 
6583
 
     def testPackRequest0(self):
6584
 
-        bin = apply(request.GetPointerMapping._request.to_binary, (), self.req_args_0)
6585
 
+        bin = request.GetPointerMapping._request.to_binary(*(), **self.req_args_0)
6586
 
         try:
6587
 
             assert bin == self.req_bin_0
6588
 
         except AssertionError:
6589
 
@@ -5437,7 +5445,7 @@
6590
 
             raise AssertionError(args)
6591
 
 
6592
 
     def testPackReply0(self):
6593
 
-        bin = apply(request.GetPointerMapping._reply.to_binary, (), self.reply_args_0)
6594
 
+        bin = request.GetPointerMapping._reply.to_binary(*(), **self.reply_args_0)
6595
 
         try:
6596
 
             assert bin == self.reply_bin_0
6597
 
         except AssertionError:
6598
 
@@ -5460,22 +5468,22 @@
6599
 
         self.req_args_0 = {
6600
 
             'keycodes': [[72, 169], [161, 154], [26, 10], [108, 187], [110, 198], [225, 88], [33, 66], [189, 147]],
6601
 
             }
6602
 
-        self.req_bin_0 = '\x76\x02\x00\x05' '\x48\xa9\xa1\x9a' \
6603
 
-            '\x1a\x0a\x6c\xbb' '\x6e\xc6\xe1\x58' \
6604
 
-            '\x21\x42\xbd\x93'
6605
 
+        self.req_bin_0 = b'\x76\x02\x00\x05' b'\x48\xa9\xa1\x9a' \
6606
 
+            b'\x1a\x0a\x6c\xbb' b'\x6e\xc6\xe1\x58' \
6607
 
+            b'\x21\x42\xbd\x93'
6608
 
 
6609
 
         self.reply_args_0 = {
6610
 
             'sequence_number': 44526,
6611
 
             'status': 188,
6612
 
             }
6613
 
-        self.reply_bin_0 = '\x01\xbc\xad\xee' '\x00\x00\x00\x00' \
6614
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6615
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6616
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
6617
 
+        self.reply_bin_0 = b'\x01\xbc\xad\xee' b'\x00\x00\x00\x00' \
6618
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6619
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6620
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
6621
 
 
6622
 
 
6623
 
     def testPackRequest0(self):
6624
 
-        bin = apply(request.SetModifierMapping._request.to_binary, (), self.req_args_0)
6625
 
+        bin = request.SetModifierMapping._request.to_binary(*(), **self.req_args_0)
6626
 
         try:
6627
 
             assert bin == self.req_bin_0
6628
 
         except AssertionError:
6629
 
@@ -5493,7 +5501,7 @@
6630
 
             raise AssertionError(args)
6631
 
 
6632
 
     def testPackReply0(self):
6633
 
-        bin = apply(request.SetModifierMapping._reply.to_binary, (), self.reply_args_0)
6634
 
+        bin = request.SetModifierMapping._reply.to_binary(*(), **self.reply_args_0)
6635
 
         try:
6636
 
             assert bin == self.reply_bin_0
6637
 
         except AssertionError:
6638
 
@@ -5515,22 +5523,22 @@
6639
 
     def setUp(self):
6640
 
         self.req_args_0 = {
6641
 
             }
6642
 
-        self.req_bin_0 = '\x77\x00\x00\x01'
6643
 
+        self.req_bin_0 = b'\x77\x00\x00\x01'
6644
 
 
6645
 
         self.reply_args_0 = {
6646
 
             'sequence_number': 58377,
6647
 
             'keycodes': [[3, 183], [213, 173], [9, 97], [35, 60], [249, 78], [175, 62], [237, 11], [26, 119]],
6648
 
             }
6649
 
-        self.reply_bin_0 = '\x01\x02\xe4\x09' '\x00\x00\x00\x04' \
6650
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6651
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6652
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
6653
 
-            '\x03\xb7\xd5\xad' '\x09\x61\x23\x3c' \
6654
 
-            '\xf9\x4e\xaf\x3e' '\xed\x0b\x1a\x77'
6655
 
+        self.reply_bin_0 = b'\x01\x02\xe4\x09' b'\x00\x00\x00\x04' \
6656
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6657
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6658
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
6659
 
+            b'\x03\xb7\xd5\xad' b'\x09\x61\x23\x3c' \
6660
 
+            b'\xf9\x4e\xaf\x3e' b'\xed\x0b\x1a\x77'
6661
 
 
6662
 
 
6663
 
     def testPackRequest0(self):
6664
 
-        bin = apply(request.GetModifierMapping._request.to_binary, (), self.req_args_0)
6665
 
+        bin = request.GetModifierMapping._request.to_binary(*(), **self.req_args_0)
6666
 
         try:
6667
 
             assert bin == self.req_bin_0
6668
 
         except AssertionError:
6669
 
@@ -5548,7 +5556,7 @@
6670
 
             raise AssertionError(args)
6671
 
 
6672
 
     def testPackReply0(self):
6673
 
-        bin = apply(request.GetModifierMapping._reply.to_binary, (), self.reply_args_0)
6674
 
+        bin = request.GetModifierMapping._reply.to_binary(*(), **self.reply_args_0)
6675
 
         try:
6676
 
             assert bin == self.reply_bin_0
6677
 
         except AssertionError:
6678
 
@@ -5570,11 +5578,11 @@
6679
 
     def setUp(self):
6680
 
         self.req_args_0 = {
6681
 
             }
6682
 
-        self.req_bin_0 = '\x7f\x00\x00\x01'
6683
 
+        self.req_bin_0 = b'\x7f\x00\x00\x01'
6684
 
 
6685
 
 
6686
 
     def testPackRequest0(self):
6687
 
-        bin = apply(request.NoOperation._request.to_binary, (), self.req_args_0)
6688
 
+        bin = request.NoOperation._request.to_binary(*(), **self.req_args_0)
6689
 
         try:
6690
 
             assert bin == self.req_bin_0
6691
 
         except AssertionError:
6692
 
Index: python-xlib-0.14+20091101/test/test_requests_le.py
6693
 
===================================================================
6694
 
--- python-xlib-0.14+20091101.orig/test/test_requests_le.py     2013-10-11 14:19:21.117971349 -0400
6695
 
+++ python-xlib-0.14+20091101/test/test_requests_le.py  2013-10-11 14:19:21.113971349 -0400
6696
 
@@ -3,7 +3,6 @@
6697
 
 import sys, os
6698
 
 sys.path.insert(1, os.path.join(sys.path[0], '..'))
6699
 
 
6700
 
-import string
6701
 
 import unittest
6702
 
 from Xlib.protocol import request, rq, event
6703
 
 import Xlib.protocol.event
6704
 
@@ -13,7 +12,7 @@
6705
 
 
6706
 
 class CmpArray:
6707
 
     def __init__(self, *args, **kws):
6708
 
-        self.array = apply(array.array, args, kws)
6709
 
+        self.array = array.array(*args, **kws)
6710
 
 
6711
 
     def __len__(self):
6712
 
         return len(self.array)
6713
 
@@ -21,16 +20,25 @@
6714
 
     def __getslice__(self, x, y):
6715
 
         return list(self.array[x:y])
6716
 
 
6717
 
+    def __getitem__(self, n):
6718
 
+        if isinstance(n, slice):
6719
 
+            return list(self.array.__getitem__(n))
6720
 
+        else:
6721
 
+            return self.array[n]
6722
 
+
6723
 
     def __getattr__(self, attr):
6724
 
         return getattr(self.array, attr)
6725
 
 
6726
 
-    def __cmp__(self, other):
6727
 
-        return cmp(self.array.tolist(), other)
6728
 
+    def __eq__(self, other):
6729
 
+        return self.array.tolist() == other
6730
 
+
6731
 
+    def __ne__(self, other):
6732
 
+        return self.array.tolist() != other
6733
 
 
6734
 
 rq.array = CmpArray
6735
 
 
6736
 
 def tohex(bin):
6737
 
-    bin = string.join(map(lambda c: '\\x%02x' % ord(c), bin), '')
6738
 
+    bin = ''.join(map(lambda c: '\\x%02x' % c, bin))
6739
 
 
6740
 
     bins = []
6741
 
     for i in range(0, len(bin), 16):
6742
 
@@ -43,7 +51,7 @@
6743
 
         except IndexError:
6744
 
             bins2.append("'%s'" % bins[i])
6745
 
 
6746
 
-    return string.join(bins2, ' \\\n            ')
6747
 
+    return ' \\\n            '.join(bins2)
6748
 
 
6749
 
 class DummyDisplay:
6750
 
     def get_resource_class(self, x):
6751
 
@@ -75,22 +83,22 @@
6752
 
             'border_width': 29625,
6753
 
             'window_class': 2,
6754
 
             }
6755
 
-        self.req_bin_0 = '\x01\xc6\x17\x00' '\xa1\x2e\xb9\x25' \
6756
 
-            '\x30\xfa\x8f\x21' '\x42\xe9\x11\x8d' \
6757
 
-            '\x1f\xd7\x5b\xf2' '\xb9\x73\x02\x00' \
6758
 
-            '\x4d\x3e\x64\x30' '\xff\x7f\x00\x00' \
6759
 
-            '\x58\x2e\x54\x4e' '\x2c\x67\x7e\x2a' \
6760
 
-            '\x35\x39\xa1\x1e' '\x2c\x60\x60\x51' \
6761
 
-            '\x06\x00\x00\x00' '\x06\x00\x00\x00' \
6762
 
-            '\x01\x00\x00\x00' '\xc4\x0f\xc8\x34' \
6763
 
-            '\x1e\xac\xf5\x64' '\x01\x00\x00\x00' \
6764
 
-            '\x00\x00\x00\x00' '\x33\x4a\x4c\x35' \
6765
 
-            '\xc3\x5e\xcd\x27' '\xb9\xb0\x69\x3a' \
6766
 
-            '\x28\x59\xfa\x2e'
6767
 
+        self.req_bin_0 = b'\x01\xc6\x17\x00' b'\xa1\x2e\xb9\x25' \
6768
 
+            b'\x30\xfa\x8f\x21' b'\x42\xe9\x11\x8d' \
6769
 
+            b'\x1f\xd7\x5b\xf2' b'\xb9\x73\x02\x00' \
6770
 
+            b'\x4d\x3e\x64\x30' b'\xff\x7f\x00\x00' \
6771
 
+            b'\x58\x2e\x54\x4e' b'\x2c\x67\x7e\x2a' \
6772
 
+            b'\x35\x39\xa1\x1e' b'\x2c\x60\x60\x51' \
6773
 
+            b'\x06\x00\x00\x00' b'\x06\x00\x00\x00' \
6774
 
+            b'\x01\x00\x00\x00' b'\xc4\x0f\xc8\x34' \
6775
 
+            b'\x1e\xac\xf5\x64' b'\x01\x00\x00\x00' \
6776
 
+            b'\x00\x00\x00\x00' b'\x33\x4a\x4c\x35' \
6777
 
+            b'\xc3\x5e\xcd\x27' b'\xb9\xb0\x69\x3a' \
6778
 
+            b'\x28\x59\xfa\x2e'
6779
 
 
6780
 
 
6781
 
     def testPackRequest0(self):
6782
 
-        bin = apply(request.CreateWindow._request.to_binary, (), self.req_args_0)
6783
 
+        bin = request.CreateWindow._request.to_binary(*(), **self.req_args_0)
6784
 
         try:
6785
 
             assert bin == self.req_bin_0
6786
 
         except AssertionError:
6787
 
@@ -114,19 +122,19 @@
6788
 
             'window': 560274578,
6789
 
             'attrs': {'cursor': 1238338372, 'override_redirect': 0, 'bit_gravity': 6, 'event_mask': 1980992429, 'border_pixel': 310964771, 'background_pixel': 1268171782, 'save_under': 1, 'colormap': 171538239, 'do_not_propagate_mask': 135558419, 'backing_store': 2, 'win_gravity': 10, 'backing_planes': 252687930, 'border_pixmap': 287169917, 'backing_pixel': 1114685309, 'background_pixmap': 2004887498},
6790
 
             }
6791
 
-        self.req_bin_0 = '\x02\x00\x12\x00' '\x92\x1c\x65\x21' \
6792
 
-            '\xff\x7f\x00\x00' '\xca\x27\x80\x77' \
6793
 
-            '\x06\xc4\x96\x4b' '\x7d\xdd\x1d\x11' \
6794
 
-            '\x23\xf2\x88\x12' '\x06\x00\x00\x00' \
6795
 
-            '\x0a\x00\x00\x00' '\x02\x00\x00\x00' \
6796
 
-            '\x3a\xb6\x0f\x0f' '\x7d\xbf\x70\x42' \
6797
 
-            '\x00\x00\x00\x00' '\x01\x00\x00\x00' \
6798
 
-            '\xad\x8b\x13\x76' '\x13\x75\x14\x08' \
6799
 
-            '\x3f\x77\x39\x0a' '\x44\x8b\xcf\x49'
6800
 
+        self.req_bin_0 = b'\x02\x00\x12\x00' b'\x92\x1c\x65\x21' \
6801
 
+            b'\xff\x7f\x00\x00' b'\xca\x27\x80\x77' \
6802
 
+            b'\x06\xc4\x96\x4b' b'\x7d\xdd\x1d\x11' \
6803
 
+            b'\x23\xf2\x88\x12' b'\x06\x00\x00\x00' \
6804
 
+            b'\x0a\x00\x00\x00' b'\x02\x00\x00\x00' \
6805
 
+            b'\x3a\xb6\x0f\x0f' b'\x7d\xbf\x70\x42' \
6806
 
+            b'\x00\x00\x00\x00' b'\x01\x00\x00\x00' \
6807
 
+            b'\xad\x8b\x13\x76' b'\x13\x75\x14\x08' \
6808
 
+            b'\x3f\x77\x39\x0a' b'\x44\x8b\xcf\x49'
6809
 
 
6810
 
 
6811
 
     def testPackRequest0(self):
6812
 
-        bin = apply(request.ChangeWindowAttributes._request.to_binary, (), self.req_args_0)
6813
 
+        bin = request.ChangeWindowAttributes._request.to_binary(*(), **self.req_args_0)
6814
 
         try:
6815
 
             assert bin == self.req_bin_0
6816
 
         except AssertionError:
6817
 
@@ -149,7 +157,7 @@
6818
 
         self.req_args_0 = {
6819
 
             'window': 1672572666,
6820
 
             }
6821
 
-        self.req_bin_0 = '\x03\x00\x02\x00' '\xfa\x6e\xb1\x63'
6822
 
+        self.req_bin_0 = b'\x03\x00\x02\x00' b'\xfa\x6e\xb1\x63'
6823
 
 
6824
 
         self.reply_args_0 = {
6825
 
             'do_not_propagate_mask': 33915,
6826
 
@@ -169,16 +177,16 @@
6827
 
             'sequence_number': 38504,
6828
 
             'colormap': 56062036,
6829
 
             }
6830
 
-        self.reply_bin_0 = '\x01\xd7\x68\x96' '\x03\x00\x00\x00' \
6831
 
-            '\xb5\x61\x9f\x54' '\x28\x3f\x80\x8c' \
6832
 
-            '\xce\xd7\xa2\x32' '\x99\xf4\xa7\x37' \
6833
 
-            '\x01\x01\xa9\x00' '\x54\x70\x57\x03' \
6834
 
-            '\xb4\x01\xc9\x3d' '\x52\xc6\x49\x0a' \
6835
 
-            '\x7b\x84\x00\x00'
6836
 
+        self.reply_bin_0 = b'\x01\xd7\x68\x96' b'\x03\x00\x00\x00' \
6837
 
+            b'\xb5\x61\x9f\x54' b'\x28\x3f\x80\x8c' \
6838
 
+            b'\xce\xd7\xa2\x32' b'\x99\xf4\xa7\x37' \
6839
 
+            b'\x01\x01\xa9\x00' b'\x54\x70\x57\x03' \
6840
 
+            b'\xb4\x01\xc9\x3d' b'\x52\xc6\x49\x0a' \
6841
 
+            b'\x7b\x84\x00\x00'
6842
 
 
6843
 
 
6844
 
     def testPackRequest0(self):
6845
 
-        bin = apply(request.GetWindowAttributes._request.to_binary, (), self.req_args_0)
6846
 
+        bin = request.GetWindowAttributes._request.to_binary(*(), **self.req_args_0)
6847
 
         try:
6848
 
             assert bin == self.req_bin_0
6849
 
         except AssertionError:
6850
 
@@ -196,7 +204,7 @@
6851
 
             raise AssertionError(args)
6852
 
 
6853
 
     def testPackReply0(self):
6854
 
-        bin = apply(request.GetWindowAttributes._reply.to_binary, (), self.reply_args_0)
6855
 
+        bin = request.GetWindowAttributes._reply.to_binary(*(), **self.reply_args_0)
6856
 
         try:
6857
 
             assert bin == self.reply_bin_0
6858
 
         except AssertionError:
6859
 
@@ -219,11 +227,11 @@
6860
 
         self.req_args_0 = {
6861
 
             'window': 533632985,
6862
 
             }
6863
 
-        self.req_bin_0 = '\x04\x00\x02\x00' '\xd9\x97\xce\x1f'
6864
 
+        self.req_bin_0 = b'\x04\x00\x02\x00' b'\xd9\x97\xce\x1f'
6865
 
 
6866
 
 
6867
 
     def testPackRequest0(self):
6868
 
-        bin = apply(request.DestroyWindow._request.to_binary, (), self.req_args_0)
6869
 
+        bin = request.DestroyWindow._request.to_binary(*(), **self.req_args_0)
6870
 
         try:
6871
 
             assert bin == self.req_bin_0
6872
 
         except AssertionError:
6873
 
@@ -246,11 +254,11 @@
6874
 
         self.req_args_0 = {
6875
 
             'window': 490680451,
6876
 
             }
6877
 
-        self.req_bin_0 = '\x05\x00\x02\x00' '\x83\x30\x3f\x1d'
6878
 
+        self.req_bin_0 = b'\x05\x00\x02\x00' b'\x83\x30\x3f\x1d'
6879
 
 
6880
 
 
6881
 
     def testPackRequest0(self):
6882
 
-        bin = apply(request.DestroySubWindows._request.to_binary, (), self.req_args_0)
6883
 
+        bin = request.DestroySubWindows._request.to_binary(*(), **self.req_args_0)
6884
 
         try:
6885
 
             assert bin == self.req_bin_0
6886
 
         except AssertionError:
6887
 
@@ -274,11 +282,11 @@
6888
 
             'window': 1974200014,
6889
 
             'mode': 0,
6890
 
             }
6891
 
-        self.req_bin_0 = '\x06\x00\x02\x00' '\xce\xe6\xab\x75'
6892
 
+        self.req_bin_0 = b'\x06\x00\x02\x00' b'\xce\xe6\xab\x75'
6893
 
 
6894
 
 
6895
 
     def testPackRequest0(self):
6896
 
-        bin = apply(request.ChangeSaveSet._request.to_binary, (), self.req_args_0)
6897
 
+        bin = request.ChangeSaveSet._request.to_binary(*(), **self.req_args_0)
6898
 
         try:
6899
 
             assert bin == self.req_bin_0
6900
 
         except AssertionError:
6901
 
@@ -304,12 +312,12 @@
6902
 
             'window': 2127670410,
6903
 
             'parent': 1913134105,
6904
 
             }
6905
 
-        self.req_bin_0 = '\x07\x00\x04\x00' '\x8a\xac\xd1\x7e' \
6906
 
-            '\x19\x1c\x08\x72' '\x10\xb9\x25\xce'
6907
 
+        self.req_bin_0 = b'\x07\x00\x04\x00' b'\x8a\xac\xd1\x7e' \
6908
 
+            b'\x19\x1c\x08\x72' b'\x10\xb9\x25\xce'
6909
 
 
6910
 
 
6911
 
     def testPackRequest0(self):
6912
 
-        bin = apply(request.ReparentWindow._request.to_binary, (), self.req_args_0)
6913
 
+        bin = request.ReparentWindow._request.to_binary(*(), **self.req_args_0)
6914
 
         try:
6915
 
             assert bin == self.req_bin_0
6916
 
         except AssertionError:
6917
 
@@ -332,11 +340,11 @@
6918
 
         self.req_args_0 = {
6919
 
             'window': 962670079,
6920
 
             }
6921
 
-        self.req_bin_0 = '\x08\x00\x02\x00' '\xff\x2d\x61\x39'
6922
 
+        self.req_bin_0 = b'\x08\x00\x02\x00' b'\xff\x2d\x61\x39'
6923
 
 
6924
 
 
6925
 
     def testPackRequest0(self):
6926
 
-        bin = apply(request.MapWindow._request.to_binary, (), self.req_args_0)
6927
 
+        bin = request.MapWindow._request.to_binary(*(), **self.req_args_0)
6928
 
         try:
6929
 
             assert bin == self.req_bin_0
6930
 
         except AssertionError:
6931
 
@@ -359,11 +367,11 @@
6932
 
         self.req_args_0 = {
6933
 
             'window': 447820952,
6934
 
             }
6935
 
-        self.req_bin_0 = '\x09\x00\x02\x00' '\x98\x34\xb1\x1a'
6936
 
+        self.req_bin_0 = b'\x09\x00\x02\x00' b'\x98\x34\xb1\x1a'
6937
 
 
6938
 
 
6939
 
     def testPackRequest0(self):
6940
 
-        bin = apply(request.MapSubwindows._request.to_binary, (), self.req_args_0)
6941
 
+        bin = request.MapSubwindows._request.to_binary(*(), **self.req_args_0)
6942
 
         try:
6943
 
             assert bin == self.req_bin_0
6944
 
         except AssertionError:
6945
 
@@ -386,11 +394,11 @@
6946
 
         self.req_args_0 = {
6947
 
             'window': 1130502889,
6948
 
             }
6949
 
-        self.req_bin_0 = '\x0a\x00\x02\x00' '\xe9\x1a\x62\x43'
6950
 
+        self.req_bin_0 = b'\x0a\x00\x02\x00' b'\xe9\x1a\x62\x43'
6951
 
 
6952
 
 
6953
 
     def testPackRequest0(self):
6954
 
-        bin = apply(request.UnmapWindow._request.to_binary, (), self.req_args_0)
6955
 
+        bin = request.UnmapWindow._request.to_binary(*(), **self.req_args_0)
6956
 
         try:
6957
 
             assert bin == self.req_bin_0
6958
 
         except AssertionError:
6959
 
@@ -413,11 +421,11 @@
6960
 
         self.req_args_0 = {
6961
 
             'window': 2009442907,
6962
 
             }
6963
 
-        self.req_bin_0 = '\x0b\x00\x02\x00' '\x5b\xaa\xc5\x77'
6964
 
+        self.req_bin_0 = b'\x0b\x00\x02\x00' b'\x5b\xaa\xc5\x77'
6965
 
 
6966
 
 
6967
 
     def testPackRequest0(self):
6968
 
-        bin = apply(request.UnmapSubwindows._request.to_binary, (), self.req_args_0)
6969
 
+        bin = request.UnmapSubwindows._request.to_binary(*(), **self.req_args_0)
6970
 
         try:
6971
 
             assert bin == self.req_bin_0
6972
 
         except AssertionError:
6973
 
@@ -441,15 +449,15 @@
6974
 
             'window': 2092974410,
6975
 
             'attrs': {'sibling': 1102940930, 'width': 52077, 'y': -11332, 'x': -11514, 'border_width': -6900, 'stack_mode': 4, 'height': 62050},
6976
 
             }
6977
 
-        self.req_bin_0 = '\x0c\x00\x0a\x00' '\x4a\x41\xc0\x7c' \
6978
 
-            '\x7f\x00\x00\x00' '\x06\xd3\x00\x00' \
6979
 
-            '\xbc\xd3\x00\x00' '\x6d\xcb\x00\x00' \
6980
 
-            '\x62\xf2\x00\x00' '\x0c\xe5\x00\x00' \
6981
 
-            '\x02\x8b\xbd\x41' '\x04\x00\x00\x00'
6982
 
+        self.req_bin_0 = b'\x0c\x00\x0a\x00' b'\x4a\x41\xc0\x7c' \
6983
 
+            b'\x7f\x00\x00\x00' b'\x06\xd3\x00\x00' \
6984
 
+            b'\xbc\xd3\x00\x00' b'\x6d\xcb\x00\x00' \
6985
 
+            b'\x62\xf2\x00\x00' b'\x0c\xe5\x00\x00' \
6986
 
+            b'\x02\x8b\xbd\x41' b'\x04\x00\x00\x00'
6987
 
 
6988
 
 
6989
 
     def testPackRequest0(self):
6990
 
-        bin = apply(request.ConfigureWindow._request.to_binary, (), self.req_args_0)
6991
 
+        bin = request.ConfigureWindow._request.to_binary(*(), **self.req_args_0)
6992
 
         try:
6993
 
             assert bin == self.req_bin_0
6994
 
         except AssertionError:
6995
 
@@ -473,11 +481,11 @@
6996
 
             'direction': 0,
6997
 
             'window': 1132872732,
6998
 
             }
6999
 
-        self.req_bin_0 = '\x0d\x00\x02\x00' '\x1c\x44\x86\x43'
7000
 
+        self.req_bin_0 = b'\x0d\x00\x02\x00' b'\x1c\x44\x86\x43'
7001
 
 
7002
 
 
7003
 
     def testPackRequest0(self):
7004
 
-        bin = apply(request.CirculateWindow._request.to_binary, (), self.req_args_0)
7005
 
+        bin = request.CirculateWindow._request.to_binary(*(), **self.req_args_0)
7006
 
         try:
7007
 
             assert bin == self.req_bin_0
7008
 
         except AssertionError:
7009
 
@@ -500,7 +508,7 @@
7010
 
         self.req_args_0 = {
7011
 
             'drawable': 2036121058,
7012
 
             }
7013
 
-        self.req_bin_0 = '\x0e\x00\x02\x00' '\xe2\xbd\x5c\x79'
7014
 
+        self.req_bin_0 = b'\x0e\x00\x02\x00' b'\xe2\xbd\x5c\x79'
7015
 
 
7016
 
         self.reply_args_0 = {
7017
 
             'width': 65264,
7018
 
@@ -512,14 +520,14 @@
7019
 
             'sequence_number': 36173,
7020
 
             'height': 9014,
7021
 
             }
7022
 
-        self.reply_bin_0 = '\x01\xfd\x4d\x8d' '\x00\x00\x00\x00' \
7023
 
-            '\xf2\xf9\x63\x1d' '\x90\x8e\xa2\xd0' \
7024
 
-            '\xf0\xfe\x36\x23' '\xb8\x4d\x00\x00' \
7025
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7026
 
+        self.reply_bin_0 = b'\x01\xfd\x4d\x8d' b'\x00\x00\x00\x00' \
7027
 
+            b'\xf2\xf9\x63\x1d' b'\x90\x8e\xa2\xd0' \
7028
 
+            b'\xf0\xfe\x36\x23' b'\xb8\x4d\x00\x00' \
7029
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7030
 
 
7031
 
 
7032
 
     def testPackRequest0(self):
7033
 
-        bin = apply(request.GetGeometry._request.to_binary, (), self.req_args_0)
7034
 
+        bin = request.GetGeometry._request.to_binary(*(), **self.req_args_0)
7035
 
         try:
7036
 
             assert bin == self.req_bin_0
7037
 
         except AssertionError:
7038
 
@@ -537,7 +545,7 @@
7039
 
             raise AssertionError(args)
7040
 
 
7041
 
     def testPackReply0(self):
7042
 
-        bin = apply(request.GetGeometry._reply.to_binary, (), self.reply_args_0)
7043
 
+        bin = request.GetGeometry._reply.to_binary(*(), **self.reply_args_0)
7044
 
         try:
7045
 
             assert bin == self.reply_bin_0
7046
 
         except AssertionError:
7047
 
@@ -560,7 +568,7 @@
7048
 
         self.req_args_0 = {
7049
 
             'window': 884880831,
7050
 
             }
7051
 
-        self.req_bin_0 = '\x0f\x00\x02\x00' '\xbf\x35\xbe\x34'
7052
 
+        self.req_bin_0 = b'\x0f\x00\x02\x00' b'\xbf\x35\xbe\x34'
7053
 
 
7054
 
         self.reply_args_0 = {
7055
 
             'parent': 701348115,
7056
 
@@ -568,18 +576,18 @@
7057
 
             'children': [1089242139, 925689046, 1668140638, 775016596, 1024466546, 1245533043, 1733661379],
7058
 
             'sequence_number': 10033,
7059
 
             }
7060
 
-        self.reply_bin_0 = '\x01\x00\x31\x27' '\x07\x00\x00\x00' \
7061
 
-            '\x35\xea\xdf\x17' '\x13\xb9\xcd\x29' \
7062
 
-            '\x07\x00\x00\x00' '\x00\x00\x00\x00' \
7063
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7064
 
-            '\x1b\x84\xec\x40' '\xd6\xe4\x2c\x37' \
7065
 
-            '\x5e\xce\x6d\x63' '\x94\xd0\x31\x2e' \
7066
 
-            '\x72\x1e\x10\x3d' '\x73\x53\x3d\x4a' \
7067
 
-            '\xc3\x92\x55\x67'
7068
 
+        self.reply_bin_0 = b'\x01\x00\x31\x27' b'\x07\x00\x00\x00' \
7069
 
+            b'\x35\xea\xdf\x17' b'\x13\xb9\xcd\x29' \
7070
 
+            b'\x07\x00\x00\x00' b'\x00\x00\x00\x00' \
7071
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7072
 
+            b'\x1b\x84\xec\x40' b'\xd6\xe4\x2c\x37' \
7073
 
+            b'\x5e\xce\x6d\x63' b'\x94\xd0\x31\x2e' \
7074
 
+            b'\x72\x1e\x10\x3d' b'\x73\x53\x3d\x4a' \
7075
 
+            b'\xc3\x92\x55\x67'
7076
 
 
7077
 
 
7078
 
     def testPackRequest0(self):
7079
 
-        bin = apply(request.QueryTree._request.to_binary, (), self.req_args_0)
7080
 
+        bin = request.QueryTree._request.to_binary(*(), **self.req_args_0)
7081
 
         try:
7082
 
             assert bin == self.req_bin_0
7083
 
         except AssertionError:
7084
 
@@ -597,7 +605,7 @@
7085
 
             raise AssertionError(args)
7086
 
 
7087
 
     def testPackReply0(self):
7088
 
-        bin = apply(request.QueryTree._reply.to_binary, (), self.reply_args_0)
7089
 
+        bin = request.QueryTree._reply.to_binary(*(), **self.reply_args_0)
7090
 
         try:
7091
 
             assert bin == self.reply_bin_0
7092
 
         except AssertionError:
7093
 
@@ -621,22 +629,22 @@
7094
 
             'name': 'fuzzy_prop',
7095
 
             'only_if_exists': 0,
7096
 
             }
7097
 
-        self.req_bin_0 = '\x10\x00\x05\x00' '\x0a\x00\x00\x00' \
7098
 
-            '\x66\x75\x7a\x7a' '\x79\x5f\x70\x72' \
7099
 
-            '\x6f\x70\x00\x00'
7100
 
+        self.req_bin_0 = b'\x10\x00\x05\x00' b'\x0a\x00\x00\x00' \
7101
 
+            b'\x66\x75\x7a\x7a' b'\x79\x5f\x70\x72' \
7102
 
+            b'\x6f\x70\x00\x00'
7103
 
 
7104
 
         self.reply_args_0 = {
7105
 
             'sequence_number': 14401,
7106
 
             'atom': 1112752381,
7107
 
             }
7108
 
-        self.reply_bin_0 = '\x01\x00\x41\x38' '\x00\x00\x00\x00' \
7109
 
-            '\xfd\x40\x53\x42' '\x00\x00\x00\x00' \
7110
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7111
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7112
 
+        self.reply_bin_0 = b'\x01\x00\x41\x38' b'\x00\x00\x00\x00' \
7113
 
+            b'\xfd\x40\x53\x42' b'\x00\x00\x00\x00' \
7114
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7115
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7116
 
 
7117
 
 
7118
 
     def testPackRequest0(self):
7119
 
-        bin = apply(request.InternAtom._request.to_binary, (), self.req_args_0)
7120
 
+        bin = request.InternAtom._request.to_binary(*(), **self.req_args_0)
7121
 
         try:
7122
 
             assert bin == self.req_bin_0
7123
 
         except AssertionError:
7124
 
@@ -654,7 +662,7 @@
7125
 
             raise AssertionError(args)
7126
 
 
7127
 
     def testPackReply0(self):
7128
 
-        bin = apply(request.InternAtom._reply.to_binary, (), self.reply_args_0)
7129
 
+        bin = request.InternAtom._reply.to_binary(*(), **self.reply_args_0)
7130
 
         try:
7131
 
             assert bin == self.reply_bin_0
7132
 
         except AssertionError:
7133
 
@@ -677,21 +685,21 @@
7134
 
         self.req_args_0 = {
7135
 
             'atom': 1234624354,
7136
 
             }
7137
 
-        self.req_bin_0 = '\x11\x00\x02\x00' '\x62\xdf\x96\x49'
7138
 
+        self.req_bin_0 = b'\x11\x00\x02\x00' b'\x62\xdf\x96\x49'
7139
 
 
7140
 
         self.reply_args_0 = {
7141
 
             'name': 'WM_CLASS',
7142
 
             'sequence_number': 2504,
7143
 
             }
7144
 
-        self.reply_bin_0 = '\x01\x00\xc8\x09' '\x02\x00\x00\x00' \
7145
 
-            '\x08\x00\x00\x00' '\x00\x00\x00\x00' \
7146
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7147
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7148
 
-            '\x57\x4d\x5f\x43' '\x4c\x41\x53\x53'
7149
 
+        self.reply_bin_0 = b'\x01\x00\xc8\x09' b'\x02\x00\x00\x00' \
7150
 
+            b'\x08\x00\x00\x00' b'\x00\x00\x00\x00' \
7151
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7152
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7153
 
+            b'\x57\x4d\x5f\x43' b'\x4c\x41\x53\x53'
7154
 
 
7155
 
 
7156
 
     def testPackRequest0(self):
7157
 
-        bin = apply(request.GetAtomName._request.to_binary, (), self.req_args_0)
7158
 
+        bin = request.GetAtomName._request.to_binary(*(), **self.req_args_0)
7159
 
         try:
7160
 
             assert bin == self.req_bin_0
7161
 
         except AssertionError:
7162
 
@@ -709,7 +717,7 @@
7163
 
             raise AssertionError(args)
7164
 
 
7165
 
     def testPackReply0(self):
7166
 
-        bin = apply(request.GetAtomName._reply.to_binary, (), self.reply_args_0)
7167
 
+        bin = request.GetAtomName._reply.to_binary(*(), **self.reply_args_0)
7168
 
         try:
7169
 
             assert bin == self.reply_bin_0
7170
 
         except AssertionError:
7171
 
@@ -736,9 +744,9 @@
7172
 
             'data': (8, ''),
7173
 
             'mode': 2,
7174
 
             }
7175
 
-        self.req_bin_0 = '\x12\x02\x06\x00' '\x25\x5d\xa4\x4a' \
7176
 
-            '\x09\x59\x27\x0e' '\xb9\xcf\x2f\x48' \
7177
 
-            '\x08\x00\x00\x00' '\x00\x00\x00\x00'
7178
 
+        self.req_bin_0 = b'\x12\x02\x06\x00' b'\x25\x5d\xa4\x4a' \
7179
 
+            b'\x09\x59\x27\x0e' b'\xb9\xcf\x2f\x48' \
7180
 
+            b'\x08\x00\x00\x00' b'\x00\x00\x00\x00'
7181
 
 
7182
 
         self.req_args_1 = {
7183
 
             'type': 347282449,
7184
 
@@ -747,10 +755,10 @@
7185
 
             'data': (8, 'foo'),
7186
 
             'mode': 1,
7187
 
             }
7188
 
-        self.req_bin_1 = '\x12\x01\x07\x00' '\x19\xec\x86\x01' \
7189
 
-            '\x25\x5d\xc9\x25' '\x11\x1c\xb3\x14' \
7190
 
-            '\x08\x00\x00\x00' '\x03\x00\x00\x00' \
7191
 
-            '\x66\x6f\x6f\x00'
7192
 
+        self.req_bin_1 = b'\x12\x01\x07\x00' b'\x19\xec\x86\x01' \
7193
 
+            b'\x25\x5d\xc9\x25' b'\x11\x1c\xb3\x14' \
7194
 
+            b'\x08\x00\x00\x00' b'\x03\x00\x00\x00' \
7195
 
+            b'\x66\x6f\x6f\x00'
7196
 
 
7197
 
         self.req_args_2 = {
7198
 
             'type': 1524334051,
7199
 
@@ -759,10 +767,10 @@
7200
 
             'data': (8, 'zoom'),
7201
 
             'mode': 1,
7202
 
             }
7203
 
-        self.req_bin_2 = '\x12\x01\x07\x00' '\xc0\xa6\xb7\x1c' \
7204
 
-            '\xc5\x16\x42\x27' '\xe3\x7d\xdb\x5a' \
7205
 
-            '\x08\x00\x00\x00' '\x04\x00\x00\x00' \
7206
 
-            '\x7a\x6f\x6f\x6d'
7207
 
+        self.req_bin_2 = b'\x12\x01\x07\x00' b'\xc0\xa6\xb7\x1c' \
7208
 
+            b'\xc5\x16\x42\x27' b'\xe3\x7d\xdb\x5a' \
7209
 
+            b'\x08\x00\x00\x00' b'\x04\x00\x00\x00' \
7210
 
+            b'\x7a\x6f\x6f\x6d'
7211
 
 
7212
 
         self.req_args_3 = {
7213
 
             'type': 1895805524,
7214
 
@@ -771,9 +779,9 @@
7215
 
             'data': (16, []),
7216
 
             'mode': 2,
7217
 
             }
7218
 
-        self.req_bin_3 = '\x12\x02\x06\x00' '\x13\xde\x9c\x0c' \
7219
 
-            '\xee\xa7\x9f\x01' '\x54\xb2\xff\x70' \
7220
 
-            '\x10\x00\x00\x00' '\x00\x00\x00\x00'
7221
 
+        self.req_bin_3 = b'\x12\x02\x06\x00' b'\x13\xde\x9c\x0c' \
7222
 
+            b'\xee\xa7\x9f\x01' b'\x54\xb2\xff\x70' \
7223
 
+            b'\x10\x00\x00\x00' b'\x00\x00\x00\x00'
7224
 
 
7225
 
         self.req_args_4 = {
7226
 
             'type': 549788841,
7227
 
@@ -782,10 +790,10 @@
7228
 
             'data': (16, [1, 2, 3]),
7229
 
             'mode': 0,
7230
 
             }
7231
 
-        self.req_bin_4 = '\x12\x00\x08\x00' '\x3c\x4c\x4d\x59' \
7232
 
-            '\x31\x43\x70\x6f' '\xa9\x1c\xc5\x20' \
7233
 
-            '\x10\x00\x00\x00' '\x03\x00\x00\x00' \
7234
 
-            '\x01\x00\x02\x00' '\x03\x00\x00\x00'
7235
 
+        self.req_bin_4 = b'\x12\x00\x08\x00' b'\x3c\x4c\x4d\x59' \
7236
 
+            b'\x31\x43\x70\x6f' b'\xa9\x1c\xc5\x20' \
7237
 
+            b'\x10\x00\x00\x00' b'\x03\x00\x00\x00' \
7238
 
+            b'\x01\x00\x02\x00' b'\x03\x00\x00\x00'
7239
 
 
7240
 
         self.req_args_5 = {
7241
 
             'type': 1083661140,
7242
 
@@ -794,10 +802,10 @@
7243
 
             'data': (16, [1, 2, 3, 4]),
7244
 
             'mode': 2,
7245
 
             }
7246
 
-        self.req_bin_5 = '\x12\x02\x08\x00' '\x66\x3b\x5c\x78' \
7247
 
-            '\x8f\x6c\x80\x17' '\x54\x5b\x97\x40' \
7248
 
-            '\x10\x00\x00\x00' '\x04\x00\x00\x00' \
7249
 
-            '\x01\x00\x02\x00' '\x03\x00\x04\x00'
7250
 
+        self.req_bin_5 = b'\x12\x02\x08\x00' b'\x66\x3b\x5c\x78' \
7251
 
+            b'\x8f\x6c\x80\x17' b'\x54\x5b\x97\x40' \
7252
 
+            b'\x10\x00\x00\x00' b'\x04\x00\x00\x00' \
7253
 
+            b'\x01\x00\x02\x00' b'\x03\x00\x04\x00'
7254
 
 
7255
 
         self.req_args_6 = {
7256
 
             'type': 761479544,
7257
 
@@ -806,9 +814,9 @@
7258
 
             'data': (32, []),
7259
 
             'mode': 2,
7260
 
             }
7261
 
-        self.req_bin_6 = '\x12\x02\x06\x00' '\x91\x3e\xf2\x4b' \
7262
 
-            '\xe1\x3f\xf1\x67' '\x78\x41\x63\x2d' \
7263
 
-            '\x20\x00\x00\x00' '\x00\x00\x00\x00'
7264
 
+        self.req_bin_6 = b'\x12\x02\x06\x00' b'\x91\x3e\xf2\x4b' \
7265
 
+            b'\xe1\x3f\xf1\x67' b'\x78\x41\x63\x2d' \
7266
 
+            b'\x20\x00\x00\x00' b'\x00\x00\x00\x00'
7267
 
 
7268
 
         self.req_args_7 = {
7269
 
             'type': 956119085,
7270
 
@@ -817,15 +825,15 @@
7271
 
             'data': (32, [1, 2, 3]),
7272
 
             'mode': 1,
7273
 
             }
7274
 
-        self.req_bin_7 = '\x12\x01\x09\x00' '\x91\x5c\xb8\x3c' \
7275
 
-            '\xbe\x5c\xe4\x28' '\x2d\x38\xfd\x38' \
7276
 
-            '\x20\x00\x00\x00' '\x03\x00\x00\x00' \
7277
 
-            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
7278
 
-            '\x03\x00\x00\x00'
7279
 
+        self.req_bin_7 = b'\x12\x01\x09\x00' b'\x91\x5c\xb8\x3c' \
7280
 
+            b'\xbe\x5c\xe4\x28' b'\x2d\x38\xfd\x38' \
7281
 
+            b'\x20\x00\x00\x00' b'\x03\x00\x00\x00' \
7282
 
+            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
7283
 
+            b'\x03\x00\x00\x00'
7284
 
 
7285
 
 
7286
 
     def testPackRequest0(self):
7287
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_0)
7288
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_0)
7289
 
         try:
7290
 
             assert bin == self.req_bin_0
7291
 
         except AssertionError:
7292
 
@@ -843,7 +851,7 @@
7293
 
             raise AssertionError(args)
7294
 
 
7295
 
     def testPackRequest1(self):
7296
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_1)
7297
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_1)
7298
 
         try:
7299
 
             assert bin == self.req_bin_1
7300
 
         except AssertionError:
7301
 
@@ -861,7 +869,7 @@
7302
 
             raise AssertionError(args)
7303
 
 
7304
 
     def testPackRequest2(self):
7305
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_2)
7306
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_2)
7307
 
         try:
7308
 
             assert bin == self.req_bin_2
7309
 
         except AssertionError:
7310
 
@@ -879,7 +887,7 @@
7311
 
             raise AssertionError(args)
7312
 
 
7313
 
     def testPackRequest3(self):
7314
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_3)
7315
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_3)
7316
 
         try:
7317
 
             assert bin == self.req_bin_3
7318
 
         except AssertionError:
7319
 
@@ -897,7 +905,7 @@
7320
 
             raise AssertionError(args)
7321
 
 
7322
 
     def testPackRequest4(self):
7323
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_4)
7324
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_4)
7325
 
         try:
7326
 
             assert bin == self.req_bin_4
7327
 
         except AssertionError:
7328
 
@@ -915,7 +923,7 @@
7329
 
             raise AssertionError(args)
7330
 
 
7331
 
     def testPackRequest5(self):
7332
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_5)
7333
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_5)
7334
 
         try:
7335
 
             assert bin == self.req_bin_5
7336
 
         except AssertionError:
7337
 
@@ -933,7 +941,7 @@
7338
 
             raise AssertionError(args)
7339
 
 
7340
 
     def testPackRequest6(self):
7341
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_6)
7342
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_6)
7343
 
         try:
7344
 
             assert bin == self.req_bin_6
7345
 
         except AssertionError:
7346
 
@@ -951,7 +959,7 @@
7347
 
             raise AssertionError(args)
7348
 
 
7349
 
     def testPackRequest7(self):
7350
 
-        bin = apply(request.ChangeProperty._request.to_binary, (), self.req_args_7)
7351
 
+        bin = request.ChangeProperty._request.to_binary(*(), **self.req_args_7)
7352
 
         try:
7353
 
             assert bin == self.req_bin_7
7354
 
         except AssertionError:
7355
 
@@ -975,12 +983,12 @@
7356
 
             'window': 1858113940,
7357
 
             'property': 754854074,
7358
 
             }
7359
 
-        self.req_bin_0 = '\x13\x00\x03\x00' '\x94\x91\xc0\x6e' \
7360
 
-            '\xba\x28\xfe\x2c'
7361
 
+        self.req_bin_0 = b'\x13\x00\x03\x00' b'\x94\x91\xc0\x6e' \
7362
 
+            b'\xba\x28\xfe\x2c'
7363
 
 
7364
 
 
7365
 
     def testPackRequest0(self):
7366
 
-        bin = apply(request.DeleteProperty._request.to_binary, (), self.req_args_0)
7367
 
+        bin = request.DeleteProperty._request.to_binary(*(), **self.req_args_0)
7368
 
         try:
7369
 
             assert bin == self.req_bin_0
7370
 
         except AssertionError:
7371
 
@@ -1008,9 +1016,9 @@
7372
 
             'long_length': 1748032051,
7373
 
             'delete': 0,
7374
 
             }
7375
 
-        self.req_bin_0 = '\x14\x00\x06\x00' '\xda\x26\xe0\x63' \
7376
 
-            '\x92\x84\xda\x73' '\x2b\x75\x56\x0d' \
7377
 
-            '\x90\x39\xaf\x00' '\x33\xda\x30\x68'
7378
 
+        self.req_bin_0 = b'\x14\x00\x06\x00' b'\xda\x26\xe0\x63' \
7379
 
+            b'\x92\x84\xda\x73' b'\x2b\x75\x56\x0d' \
7380
 
+            b'\x90\x39\xaf\x00' b'\x33\xda\x30\x68'
7381
 
 
7382
 
         self.reply_args_0 = {
7383
 
             'bytes_after': 1264377294,
7384
 
@@ -1018,10 +1026,10 @@
7385
 
             'sequence_number': 34281,
7386
 
             'value': (8, ''),
7387
 
             }
7388
 
-        self.reply_bin_0 = '\x01\x08\xe9\x85' '\x00\x00\x00\x00' \
7389
 
-            '\x02\xc9\xe6\x4d' '\xce\xdd\x5c\x4b' \
7390
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7391
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7392
 
+        self.reply_bin_0 = b'\x01\x08\xe9\x85' b'\x00\x00\x00\x00' \
7393
 
+            b'\x02\xc9\xe6\x4d' b'\xce\xdd\x5c\x4b' \
7394
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7395
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7396
 
 
7397
 
         self.reply_args_1 = {
7398
 
             'bytes_after': 902042689,
7399
 
@@ -1029,11 +1037,11 @@
7400
 
             'sequence_number': 50371,
7401
 
             'value': (8, 'foo'),
7402
 
             }
7403
 
-        self.reply_bin_1 = '\x01\x08\xc3\xc4' '\x01\x00\x00\x00' \
7404
 
-            '\x13\x3f\x14\x6e' '\x41\x14\xc4\x35' \
7405
 
-            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
7406
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7407
 
-            '\x66\x6f\x6f\x00'
7408
 
+        self.reply_bin_1 = b'\x01\x08\xc3\xc4' b'\x01\x00\x00\x00' \
7409
 
+            b'\x13\x3f\x14\x6e' b'\x41\x14\xc4\x35' \
7410
 
+            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
7411
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7412
 
+            b'\x66\x6f\x6f\x00'
7413
 
 
7414
 
         self.reply_args_2 = {
7415
 
             'bytes_after': 1782597051,
7416
 
@@ -1041,11 +1049,11 @@
7417
 
             'sequence_number': 58679,
7418
 
             'value': (8, 'zoom'),
7419
 
             }
7420
 
-        self.reply_bin_2 = '\x01\x08\x37\xe5' '\x01\x00\x00\x00' \
7421
 
-            '\x47\xc4\x2e\x60' '\xbb\x45\x40\x6a' \
7422
 
-            '\x04\x00\x00\x00' '\x00\x00\x00\x00' \
7423
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7424
 
-            '\x7a\x6f\x6f\x6d'
7425
 
+        self.reply_bin_2 = b'\x01\x08\x37\xe5' b'\x01\x00\x00\x00' \
7426
 
+            b'\x47\xc4\x2e\x60' b'\xbb\x45\x40\x6a' \
7427
 
+            b'\x04\x00\x00\x00' b'\x00\x00\x00\x00' \
7428
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7429
 
+            b'\x7a\x6f\x6f\x6d'
7430
 
 
7431
 
         self.reply_args_3 = {
7432
 
             'bytes_after': 1107167742,
7433
 
@@ -1053,10 +1061,10 @@
7434
 
             'sequence_number': 49647,
7435
 
             'value': (16, []),
7436
 
             }
7437
 
-        self.reply_bin_3 = '\x01\x10\xef\xc1' '\x00\x00\x00\x00' \
7438
 
-            '\xfa\x06\x1f\x75' '\xfe\x09\xfe\x41' \
7439
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7440
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7441
 
+        self.reply_bin_3 = b'\x01\x10\xef\xc1' b'\x00\x00\x00\x00' \
7442
 
+            b'\xfa\x06\x1f\x75' b'\xfe\x09\xfe\x41' \
7443
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7444
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7445
 
 
7446
 
         self.reply_args_4 = {
7447
 
             'bytes_after': 1602466976,
7448
 
@@ -1064,11 +1072,11 @@
7449
 
             'sequence_number': 58268,
7450
 
             'value': (16, [1, 2, 3]),
7451
 
             }
7452
 
-        self.reply_bin_4 = '\x01\x10\x9c\xe3' '\x02\x00\x00\x00' \
7453
 
-            '\x24\x3d\x11\x26' '\xa0\xb4\x83\x5f' \
7454
 
-            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
7455
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7456
 
-            '\x01\x00\x02\x00' '\x03\x00\x00\x00'
7457
 
+        self.reply_bin_4 = b'\x01\x10\x9c\xe3' b'\x02\x00\x00\x00' \
7458
 
+            b'\x24\x3d\x11\x26' b'\xa0\xb4\x83\x5f' \
7459
 
+            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
7460
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7461
 
+            b'\x01\x00\x02\x00' b'\x03\x00\x00\x00'
7462
 
 
7463
 
         self.reply_args_5 = {
7464
 
             'bytes_after': 651542717,
7465
 
@@ -1076,11 +1084,11 @@
7466
 
             'sequence_number': 26901,
7467
 
             'value': (16, [1, 2, 3, 4]),
7468
 
             }
7469
 
-        self.reply_bin_5 = '\x01\x10\x15\x69' '\x02\x00\x00\x00' \
7470
 
-            '\xe6\x9d\x78\x38' '\xbd\xc0\xd5\x26' \
7471
 
-            '\x04\x00\x00\x00' '\x00\x00\x00\x00' \
7472
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7473
 
-            '\x01\x00\x02\x00' '\x03\x00\x04\x00'
7474
 
+        self.reply_bin_5 = b'\x01\x10\x15\x69' b'\x02\x00\x00\x00' \
7475
 
+            b'\xe6\x9d\x78\x38' b'\xbd\xc0\xd5\x26' \
7476
 
+            b'\x04\x00\x00\x00' b'\x00\x00\x00\x00' \
7477
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7478
 
+            b'\x01\x00\x02\x00' b'\x03\x00\x04\x00'
7479
 
 
7480
 
         self.reply_args_6 = {
7481
 
             'bytes_after': 602498418,
7482
 
@@ -1088,10 +1096,10 @@
7483
 
             'sequence_number': 11175,
7484
 
             'value': (32, []),
7485
 
             }
7486
 
-        self.reply_bin_6 = '\x01\x20\xa7\x2b' '\x00\x00\x00\x00' \
7487
 
-            '\x7e\xa7\x98\x02' '\x72\x65\xe9\x23' \
7488
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7489
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7490
 
+        self.reply_bin_6 = b'\x01\x20\xa7\x2b' b'\x00\x00\x00\x00' \
7491
 
+            b'\x7e\xa7\x98\x02' b'\x72\x65\xe9\x23' \
7492
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7493
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7494
 
 
7495
 
         self.reply_args_7 = {
7496
 
             'bytes_after': 1661909208,
7497
 
@@ -1099,16 +1107,16 @@
7498
 
             'sequence_number': 4347,
7499
 
             'value': (32, [1, 2, 3]),
7500
 
             }
7501
 
-        self.reply_bin_7 = '\x01\x20\xfb\x10' '\x03\x00\x00\x00' \
7502
 
-            '\x08\xf7\x2e\x24' '\xd8\xb8\x0e\x63' \
7503
 
-            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
7504
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7505
 
-            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
7506
 
-            '\x03\x00\x00\x00'
7507
 
+        self.reply_bin_7 = b'\x01\x20\xfb\x10' b'\x03\x00\x00\x00' \
7508
 
+            b'\x08\xf7\x2e\x24' b'\xd8\xb8\x0e\x63' \
7509
 
+            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
7510
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7511
 
+            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
7512
 
+            b'\x03\x00\x00\x00'
7513
 
 
7514
 
 
7515
 
     def testPackRequest0(self):
7516
 
-        bin = apply(request.GetProperty._request.to_binary, (), self.req_args_0)
7517
 
+        bin = request.GetProperty._request.to_binary(*(), **self.req_args_0)
7518
 
         try:
7519
 
             assert bin == self.req_bin_0
7520
 
         except AssertionError:
7521
 
@@ -1126,7 +1134,7 @@
7522
 
             raise AssertionError(args)
7523
 
 
7524
 
     def testPackReply0(self):
7525
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_0)
7526
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_0)
7527
 
         try:
7528
 
             assert bin == self.reply_bin_0
7529
 
         except AssertionError:
7530
 
@@ -1144,7 +1152,7 @@
7531
 
             raise AssertionError(args)
7532
 
 
7533
 
     def testPackReply1(self):
7534
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_1)
7535
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_1)
7536
 
         try:
7537
 
             assert bin == self.reply_bin_1
7538
 
         except AssertionError:
7539
 
@@ -1162,7 +1170,7 @@
7540
 
             raise AssertionError(args)
7541
 
 
7542
 
     def testPackReply2(self):
7543
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_2)
7544
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_2)
7545
 
         try:
7546
 
             assert bin == self.reply_bin_2
7547
 
         except AssertionError:
7548
 
@@ -1180,7 +1188,7 @@
7549
 
             raise AssertionError(args)
7550
 
 
7551
 
     def testPackReply3(self):
7552
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_3)
7553
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_3)
7554
 
         try:
7555
 
             assert bin == self.reply_bin_3
7556
 
         except AssertionError:
7557
 
@@ -1198,7 +1206,7 @@
7558
 
             raise AssertionError(args)
7559
 
 
7560
 
     def testPackReply4(self):
7561
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_4)
7562
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_4)
7563
 
         try:
7564
 
             assert bin == self.reply_bin_4
7565
 
         except AssertionError:
7566
 
@@ -1216,7 +1224,7 @@
7567
 
             raise AssertionError(args)
7568
 
 
7569
 
     def testPackReply5(self):
7570
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_5)
7571
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_5)
7572
 
         try:
7573
 
             assert bin == self.reply_bin_5
7574
 
         except AssertionError:
7575
 
@@ -1234,7 +1242,7 @@
7576
 
             raise AssertionError(args)
7577
 
 
7578
 
     def testPackReply6(self):
7579
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_6)
7580
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_6)
7581
 
         try:
7582
 
             assert bin == self.reply_bin_6
7583
 
         except AssertionError:
7584
 
@@ -1252,7 +1260,7 @@
7585
 
             raise AssertionError(args)
7586
 
 
7587
 
     def testPackReply7(self):
7588
 
-        bin = apply(request.GetProperty._reply.to_binary, (), self.reply_args_7)
7589
 
+        bin = request.GetProperty._reply.to_binary(*(), **self.reply_args_7)
7590
 
         try:
7591
 
             assert bin == self.reply_bin_7
7592
 
         except AssertionError:
7593
 
@@ -1275,32 +1283,32 @@
7594
 
         self.req_args_0 = {
7595
 
             'window': 1002132678,
7596
 
             }
7597
 
-        self.req_bin_0 = '\x15\x00\x02\x00' '\xc6\x54\xbb\x3b'
7598
 
+        self.req_bin_0 = b'\x15\x00\x02\x00' b'\xc6\x54\xbb\x3b'
7599
 
 
7600
 
         self.reply_args_0 = {
7601
 
             'sequence_number': 58554,
7602
 
             'atoms': [497337753, 1561366096, 1429910722, 371682445, 1693790956, 124266489, 819023111, 1575252239, 1958056613, 76461795, 2044963121, 1187630009, 890357857, 639310702, 1708479530, 336050724, 1163834063, 1164094286, 1626309474, 136351014, 1163110454, 1416739018, 1380223836],
7603
 
             }
7604
 
-        self.reply_bin_0 = '\x01\x00\xba\xe4' '\x17\x00\x00\x00' \
7605
 
-            '\x17\x00\x00\x00' '\x00\x00\x00\x00' \
7606
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7607
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7608
 
-            '\x99\xc5\xa4\x1d' '\x50\x8e\x10\x5d' \
7609
 
-            '\xc2\xb4\x3a\x55' '\x8d\x6c\x27\x16' \
7610
 
-            '\xec\x32\xf5\x64' '\xf9\x27\x68\x07' \
7611
 
-            '\x07\x4d\xd1\x30' '\x0f\x71\xe4\x5d' \
7612
 
-            '\xa5\x92\xb5\x74' '\xe3\xb6\x8e\x04' \
7613
 
-            '\x31\xa9\xe3\x79' '\xb9\xcb\xc9\x46' \
7614
 
-            '\x61\xc8\x11\x35' '\x6e\x1b\x1b\x26' \
7615
 
-            '\x2a\x54\xd5\x65' '\x24\xba\x07\x14' \
7616
 
-            '\xcf\xb2\x5e\x45' '\x4e\xab\x62\x45' \
7617
 
-            '\x62\x83\xef\x60' '\x26\x8d\x20\x08' \
7618
 
-            '\x36\xa8\x53\x45' '\xca\xb8\x71\x54' \
7619
 
-            '\x5c\x8b\x44\x52'
7620
 
+        self.reply_bin_0 = b'\x01\x00\xba\xe4' b'\x17\x00\x00\x00' \
7621
 
+            b'\x17\x00\x00\x00' b'\x00\x00\x00\x00' \
7622
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7623
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7624
 
+            b'\x99\xc5\xa4\x1d' b'\x50\x8e\x10\x5d' \
7625
 
+            b'\xc2\xb4\x3a\x55' b'\x8d\x6c\x27\x16' \
7626
 
+            b'\xec\x32\xf5\x64' b'\xf9\x27\x68\x07' \
7627
 
+            b'\x07\x4d\xd1\x30' b'\x0f\x71\xe4\x5d' \
7628
 
+            b'\xa5\x92\xb5\x74' b'\xe3\xb6\x8e\x04' \
7629
 
+            b'\x31\xa9\xe3\x79' b'\xb9\xcb\xc9\x46' \
7630
 
+            b'\x61\xc8\x11\x35' b'\x6e\x1b\x1b\x26' \
7631
 
+            b'\x2a\x54\xd5\x65' b'\x24\xba\x07\x14' \
7632
 
+            b'\xcf\xb2\x5e\x45' b'\x4e\xab\x62\x45' \
7633
 
+            b'\x62\x83\xef\x60' b'\x26\x8d\x20\x08' \
7634
 
+            b'\x36\xa8\x53\x45' b'\xca\xb8\x71\x54' \
7635
 
+            b'\x5c\x8b\x44\x52'
7636
 
 
7637
 
 
7638
 
     def testPackRequest0(self):
7639
 
-        bin = apply(request.ListProperties._request.to_binary, (), self.req_args_0)
7640
 
+        bin = request.ListProperties._request.to_binary(*(), **self.req_args_0)
7641
 
         try:
7642
 
             assert bin == self.req_bin_0
7643
 
         except AssertionError:
7644
 
@@ -1318,7 +1326,7 @@
7645
 
             raise AssertionError(args)
7646
 
 
7647
 
     def testPackReply0(self):
7648
 
-        bin = apply(request.ListProperties._reply.to_binary, (), self.reply_args_0)
7649
 
+        bin = request.ListProperties._reply.to_binary(*(), **self.reply_args_0)
7650
 
         try:
7651
 
             assert bin == self.reply_bin_0
7652
 
         except AssertionError:
7653
 
@@ -1343,12 +1351,12 @@
7654
 
             'selection': 984224380,
7655
 
             'time': 2112448956,
7656
 
             }
7657
 
-        self.req_bin_0 = '\x16\x00\x04\x00' '\x4d\x88\xcd\x5d' \
7658
 
-            '\x7c\x12\xaa\x3a' '\xbc\x69\xe9\x7d'
7659
 
+        self.req_bin_0 = b'\x16\x00\x04\x00' b'\x4d\x88\xcd\x5d' \
7660
 
+            b'\x7c\x12\xaa\x3a' b'\xbc\x69\xe9\x7d'
7661
 
 
7662
 
 
7663
 
     def testPackRequest0(self):
7664
 
-        bin = apply(request.SetSelectionOwner._request.to_binary, (), self.req_args_0)
7665
 
+        bin = request.SetSelectionOwner._request.to_binary(*(), **self.req_args_0)
7666
 
         try:
7667
 
             assert bin == self.req_bin_0
7668
 
         except AssertionError:
7669
 
@@ -1371,20 +1379,20 @@
7670
 
         self.req_args_0 = {
7671
 
             'selection': 1209066471,
7672
 
             }
7673
 
-        self.req_bin_0 = '\x17\x00\x02\x00' '\xe7\xe3\x10\x48'
7674
 
+        self.req_bin_0 = b'\x17\x00\x02\x00' b'\xe7\xe3\x10\x48'
7675
 
 
7676
 
         self.reply_args_0 = {
7677
 
             'owner': 1608499874,
7678
 
             'sequence_number': 40856,
7679
 
             }
7680
 
-        self.reply_bin_0 = '\x01\x00\x98\x9f' '\x00\x00\x00\x00' \
7681
 
-            '\xa2\xc2\xdf\x5f' '\x00\x00\x00\x00' \
7682
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7683
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7684
 
+        self.reply_bin_0 = b'\x01\x00\x98\x9f' b'\x00\x00\x00\x00' \
7685
 
+            b'\xa2\xc2\xdf\x5f' b'\x00\x00\x00\x00' \
7686
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7687
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7688
 
 
7689
 
 
7690
 
     def testPackRequest0(self):
7691
 
-        bin = apply(request.GetSelectionOwner._request.to_binary, (), self.req_args_0)
7692
 
+        bin = request.GetSelectionOwner._request.to_binary(*(), **self.req_args_0)
7693
 
         try:
7694
 
             assert bin == self.req_bin_0
7695
 
         except AssertionError:
7696
 
@@ -1402,7 +1410,7 @@
7697
 
             raise AssertionError(args)
7698
 
 
7699
 
     def testPackReply0(self):
7700
 
-        bin = apply(request.GetSelectionOwner._reply.to_binary, (), self.reply_args_0)
7701
 
+        bin = request.GetSelectionOwner._reply.to_binary(*(), **self.reply_args_0)
7702
 
         try:
7703
 
             assert bin == self.reply_bin_0
7704
 
         except AssertionError:
7705
 
@@ -1429,13 +1437,13 @@
7706
 
             'target': 1621875689,
7707
 
             'time': 385931637,
7708
 
             }
7709
 
-        self.req_bin_0 = '\x18\x00\x06\x00' '\x51\x10\xc4\x09' \
7710
 
-            '\xbe\x15\xaf\x0e' '\xe9\xdb\xab\x60' \
7711
 
-            '\x0f\x2b\xee\x06' '\x75\xd9\x00\x17'
7712
 
+        self.req_bin_0 = b'\x18\x00\x06\x00' b'\x51\x10\xc4\x09' \
7713
 
+            b'\xbe\x15\xaf\x0e' b'\xe9\xdb\xab\x60' \
7714
 
+            b'\x0f\x2b\xee\x06' b'\x75\xd9\x00\x17'
7715
 
 
7716
 
 
7717
 
     def testPackRequest0(self):
7718
 
-        bin = apply(request.ConvertSelection._request.to_binary, (), self.req_args_0)
7719
 
+        bin = request.ConvertSelection._request.to_binary(*(), **self.req_args_0)
7720
 
         try:
7721
 
             assert bin == self.req_bin_0
7722
 
         except AssertionError:
7723
 
@@ -1461,16 +1469,16 @@
7724
 
             'propagate': 1,
7725
 
             'event': Xlib.protocol.event.Expose(count = 7721, width = 18606, window = 1339231972, y = 45287, x = 46510, type = 12, sequence_number = 0, height = 44735),
7726
 
             }
7727
 
-        self.req_bin_0 = '\x19\x01\x0b\x00' '\xd8\xda\x29\x62' \
7728
 
-            '\x50\xdb\xc4\x3a' '\x0c\x00\x00\x00' \
7729
 
-            '\xe4\x0e\xd3\x4f' '\xae\xb5\xe7\xb0' \
7730
 
-            '\xae\x48\xbf\xae' '\x29\x1e\x00\x00' \
7731
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7732
 
-            '\x00\x00\x00\x00'
7733
 
+        self.req_bin_0 = b'\x19\x01\x0b\x00' b'\xd8\xda\x29\x62' \
7734
 
+            b'\x50\xdb\xc4\x3a' b'\x0c\x00\x00\x00' \
7735
 
+            b'\xe4\x0e\xd3\x4f' b'\xae\xb5\xe7\xb0' \
7736
 
+            b'\xae\x48\xbf\xae' b'\x29\x1e\x00\x00' \
7737
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7738
 
+            b'\x00\x00\x00\x00'
7739
 
 
7740
 
 
7741
 
     def testPackRequest0(self):
7742
 
-        bin = apply(request.SendEvent._request.to_binary, (), self.req_args_0)
7743
 
+        bin = request.SendEvent._request.to_binary(*(), **self.req_args_0)
7744
 
         try:
7745
 
             assert bin == self.req_bin_0
7746
 
         except AssertionError:
7747
 
@@ -1500,22 +1508,22 @@
7748
 
             'grab_window': 1295558486,
7749
 
             'owner_events': 1,
7750
 
             }
7751
 
-        self.req_bin_0 = '\x1a\x01\x06\x00' '\x56\xa7\x38\x4d' \
7752
 
-            '\x12\x6b\x01\x00' '\xca\xe1\x02\x5b' \
7753
 
-            '\xe7\xde\xb2\x69' '\xa7\xfa\x3e\x47'
7754
 
+        self.req_bin_0 = b'\x1a\x01\x06\x00' b'\x56\xa7\x38\x4d' \
7755
 
+            b'\x12\x6b\x01\x00' b'\xca\xe1\x02\x5b' \
7756
 
+            b'\xe7\xde\xb2\x69' b'\xa7\xfa\x3e\x47'
7757
 
 
7758
 
         self.reply_args_0 = {
7759
 
             'status': 166,
7760
 
             'sequence_number': 9454,
7761
 
             }
7762
 
-        self.reply_bin_0 = '\x01\xa6\xee\x24' '\x00\x00\x00\x00' \
7763
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7764
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7765
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7766
 
+        self.reply_bin_0 = b'\x01\xa6\xee\x24' b'\x00\x00\x00\x00' \
7767
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7768
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7769
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7770
 
 
7771
 
 
7772
 
     def testPackRequest0(self):
7773
 
-        bin = apply(request.GrabPointer._request.to_binary, (), self.req_args_0)
7774
 
+        bin = request.GrabPointer._request.to_binary(*(), **self.req_args_0)
7775
 
         try:
7776
 
             assert bin == self.req_bin_0
7777
 
         except AssertionError:
7778
 
@@ -1533,7 +1541,7 @@
7779
 
             raise AssertionError(args)
7780
 
 
7781
 
     def testPackReply0(self):
7782
 
-        bin = apply(request.GrabPointer._reply.to_binary, (), self.reply_args_0)
7783
 
+        bin = request.GrabPointer._reply.to_binary(*(), **self.reply_args_0)
7784
 
         try:
7785
 
             assert bin == self.reply_bin_0
7786
 
         except AssertionError:
7787
 
@@ -1556,11 +1564,11 @@
7788
 
         self.req_args_0 = {
7789
 
             'time': 1647345145,
7790
 
             }
7791
 
-        self.req_bin_0 = '\x1b\x00\x02\x00' '\xf9\x7d\x30\x62'
7792
 
+        self.req_bin_0 = b'\x1b\x00\x02\x00' b'\xf9\x7d\x30\x62'
7793
 
 
7794
 
 
7795
 
     def testPackRequest0(self):
7796
 
-        bin = apply(request.UngrabPointer._request.to_binary, (), self.req_args_0)
7797
 
+        bin = request.UngrabPointer._request.to_binary(*(), **self.req_args_0)
7798
 
         try:
7799
 
             assert bin == self.req_bin_0
7800
 
         except AssertionError:
7801
 
@@ -1591,13 +1599,13 @@
7802
 
             'grab_window': 2055413885,
7803
 
             'owner_events': 0,
7804
 
             }
7805
 
-        self.req_bin_0 = '\x1c\x00\x06\x00' '\x7d\x20\x83\x7a' \
7806
 
-            '\xa4\x5c\x01\x00' '\xa3\x8d\xf5\x7a' \
7807
 
-            '\xd9\x94\x06\x5a' '\xa9\x00\x95\xf4'
7808
 
+        self.req_bin_0 = b'\x1c\x00\x06\x00' b'\x7d\x20\x83\x7a' \
7809
 
+            b'\xa4\x5c\x01\x00' b'\xa3\x8d\xf5\x7a' \
7810
 
+            b'\xd9\x94\x06\x5a' b'\xa9\x00\x95\xf4'
7811
 
 
7812
 
 
7813
 
     def testPackRequest0(self):
7814
 
-        bin = apply(request.GrabButton._request.to_binary, (), self.req_args_0)
7815
 
+        bin = request.GrabButton._request.to_binary(*(), **self.req_args_0)
7816
 
         try:
7817
 
             assert bin == self.req_bin_0
7818
 
         except AssertionError:
7819
 
@@ -1622,12 +1630,12 @@
7820
 
             'modifiers': 32389,
7821
 
             'grab_window': 1891977189,
7822
 
             }
7823
 
-        self.req_bin_0 = '\x1d\xdc\x03\x00' '\xe5\x47\xc5\x70' \
7824
 
-            '\x85\x7e\x00\x00'
7825
 
+        self.req_bin_0 = b'\x1d\xdc\x03\x00' b'\xe5\x47\xc5\x70' \
7826
 
+            b'\x85\x7e\x00\x00'
7827
 
 
7828
 
 
7829
 
     def testPackRequest0(self):
7830
 
-        bin = apply(request.UngrabButton._request.to_binary, (), self.req_args_0)
7831
 
+        bin = request.UngrabButton._request.to_binary(*(), **self.req_args_0)
7832
 
         try:
7833
 
             assert bin == self.req_bin_0
7834
 
         except AssertionError:
7835
 
@@ -1652,12 +1660,12 @@
7836
 
             'event_mask': 12743,
7837
 
             'time': 197998305,
7838
 
             }
7839
 
-        self.req_bin_0 = '\x1e\x00\x04\x00' '\x0c\xd9\x5e\x2e' \
7840
 
-            '\xe1\x36\xcd\x0b' '\xc7\x31\x00\x00'
7841
 
+        self.req_bin_0 = b'\x1e\x00\x04\x00' b'\x0c\xd9\x5e\x2e' \
7842
 
+            b'\xe1\x36\xcd\x0b' b'\xc7\x31\x00\x00'
7843
 
 
7844
 
 
7845
 
     def testPackRequest0(self):
7846
 
-        bin = apply(request.ChangeActivePointerGrab._request.to_binary, (), self.req_args_0)
7847
 
+        bin = request.ChangeActivePointerGrab._request.to_binary(*(), **self.req_args_0)
7848
 
         try:
7849
 
             assert bin == self.req_bin_0
7850
 
         except AssertionError:
7851
 
@@ -1684,21 +1692,21 @@
7852
 
             'grab_window': 316814295,
7853
 
             'owner_events': 0,
7854
 
             }
7855
 
-        self.req_bin_0 = '\x1f\x00\x04\x00' '\xd7\x33\xe2\x12' \
7856
 
-            '\x93\x11\x1d\x65' '\x00\x01\x00\x00'
7857
 
+        self.req_bin_0 = b'\x1f\x00\x04\x00' b'\xd7\x33\xe2\x12' \
7858
 
+            b'\x93\x11\x1d\x65' b'\x00\x01\x00\x00'
7859
 
 
7860
 
         self.reply_args_0 = {
7861
 
             'status': 239,
7862
 
             'sequence_number': 46747,
7863
 
             }
7864
 
-        self.reply_bin_0 = '\x01\xef\x9b\xb6' '\x00\x00\x00\x00' \
7865
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7866
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
7867
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
7868
 
+        self.reply_bin_0 = b'\x01\xef\x9b\xb6' b'\x00\x00\x00\x00' \
7869
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7870
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
7871
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
7872
 
 
7873
 
 
7874
 
     def testPackRequest0(self):
7875
 
-        bin = apply(request.GrabKeyboard._request.to_binary, (), self.req_args_0)
7876
 
+        bin = request.GrabKeyboard._request.to_binary(*(), **self.req_args_0)
7877
 
         try:
7878
 
             assert bin == self.req_bin_0
7879
 
         except AssertionError:
7880
 
@@ -1716,7 +1724,7 @@
7881
 
             raise AssertionError(args)
7882
 
 
7883
 
     def testPackReply0(self):
7884
 
-        bin = apply(request.GrabKeyboard._reply.to_binary, (), self.reply_args_0)
7885
 
+        bin = request.GrabKeyboard._reply.to_binary(*(), **self.reply_args_0)
7886
 
         try:
7887
 
             assert bin == self.reply_bin_0
7888
 
         except AssertionError:
7889
 
@@ -1739,11 +1747,11 @@
7890
 
         self.req_args_0 = {
7891
 
             'time': 4211611,
7892
 
             }
7893
 
-        self.req_bin_0 = '\x20\x00\x02\x00' '\x9b\x43\x40\x00'
7894
 
+        self.req_bin_0 = b'\x20\x00\x02\x00' b'\x9b\x43\x40\x00'
7895
 
 
7896
 
 
7897
 
     def testPackRequest0(self):
7898
 
-        bin = apply(request.UngrabKeyboard._request.to_binary, (), self.req_args_0)
7899
 
+        bin = request.UngrabKeyboard._request.to_binary(*(), **self.req_args_0)
7900
 
         try:
7901
 
             assert bin == self.req_bin_0
7902
 
         except AssertionError:
7903
 
@@ -1771,12 +1779,12 @@
7904
 
             'grab_window': 882662093,
7905
 
             'owner_events': 1,
7906
 
             }
7907
 
-        self.req_bin_0 = '\x21\x01\x04\x00' '\xcd\x5a\x9c\x34' \
7908
 
-            '\x37\xf2\xaf\x00' '\x00\x00\x00\x00'
7909
 
+        self.req_bin_0 = b'\x21\x01\x04\x00' b'\xcd\x5a\x9c\x34' \
7910
 
+            b'\x37\xf2\xaf\x00' b'\x00\x00\x00\x00'
7911
 
 
7912
 
 
7913
 
     def testPackRequest0(self):
7914
 
-        bin = apply(request.GrabKey._request.to_binary, (), self.req_args_0)
7915
 
+        bin = request.GrabKey._request.to_binary(*(), **self.req_args_0)
7916
 
         try:
7917
 
             assert bin == self.req_bin_0
7918
 
         except AssertionError:
7919
 
@@ -1801,12 +1809,12 @@
7920
 
             'grab_window': 1389213966,
7921
 
             'key': 141,
7922
 
             }
7923
 
-        self.req_bin_0 = '\x22\x8d\x03\x00' '\x0e\xb9\xcd\x52' \
7924
 
-            '\x9e\x48\x00\x00'
7925
 
+        self.req_bin_0 = b'\x22\x8d\x03\x00' b'\x0e\xb9\xcd\x52' \
7926
 
+            b'\x9e\x48\x00\x00'
7927
 
 
7928
 
 
7929
 
     def testPackRequest0(self):
7930
 
-        bin = apply(request.UngrabKey._request.to_binary, (), self.req_args_0)
7931
 
+        bin = request.UngrabKey._request.to_binary(*(), **self.req_args_0)
7932
 
         try:
7933
 
             assert bin == self.req_bin_0
7934
 
         except AssertionError:
7935
 
@@ -1830,11 +1838,11 @@
7936
 
             'mode': 7,
7937
 
             'time': 1088990319,
7938
 
             }
7939
 
-        self.req_bin_0 = '\x23\x07\x02\x00' '\x6f\xac\xe8\x40'
7940
 
+        self.req_bin_0 = b'\x23\x07\x02\x00' b'\x6f\xac\xe8\x40'
7941
 
 
7942
 
 
7943
 
     def testPackRequest0(self):
7944
 
-        bin = apply(request.AllowEvents._request.to_binary, (), self.req_args_0)
7945
 
+        bin = request.AllowEvents._request.to_binary(*(), **self.req_args_0)
7946
 
         try:
7947
 
             assert bin == self.req_bin_0
7948
 
         except AssertionError:
7949
 
@@ -1856,11 +1864,11 @@
7950
 
     def setUp(self):
7951
 
         self.req_args_0 = {
7952
 
             }
7953
 
-        self.req_bin_0 = '\x24\x00\x01\x00'
7954
 
+        self.req_bin_0 = b'\x24\x00\x01\x00'
7955
 
 
7956
 
 
7957
 
     def testPackRequest0(self):
7958
 
-        bin = apply(request.GrabServer._request.to_binary, (), self.req_args_0)
7959
 
+        bin = request.GrabServer._request.to_binary(*(), **self.req_args_0)
7960
 
         try:
7961
 
             assert bin == self.req_bin_0
7962
 
         except AssertionError:
7963
 
@@ -1882,11 +1890,11 @@
7964
 
     def setUp(self):
7965
 
         self.req_args_0 = {
7966
 
             }
7967
 
-        self.req_bin_0 = '\x25\x00\x01\x00'
7968
 
+        self.req_bin_0 = b'\x25\x00\x01\x00'
7969
 
 
7970
 
 
7971
 
     def testPackRequest0(self):
7972
 
-        bin = apply(request.UngrabServer._request.to_binary, (), self.req_args_0)
7973
 
+        bin = request.UngrabServer._request.to_binary(*(), **self.req_args_0)
7974
 
         try:
7975
 
             assert bin == self.req_bin_0
7976
 
         except AssertionError:
7977
 
@@ -1909,7 +1917,7 @@
7978
 
         self.req_args_0 = {
7979
 
             'window': 358895460,
7980
 
             }
7981
 
-        self.req_bin_0 = '\x26\x00\x02\x00' '\x64\x4f\x64\x15'
7982
 
+        self.req_bin_0 = b'\x26\x00\x02\x00' b'\x64\x4f\x64\x15'
7983
 
 
7984
 
         self.reply_args_0 = {
7985
 
             'same_screen': 1,
7986
 
@@ -1922,14 +1930,14 @@
7987
 
             'sequence_number': 29530,
7988
 
             'win_y': -19690,
7989
 
             }
7990
 
-        self.reply_bin_0 = '\x01\x01\x5a\x73' '\x00\x00\x00\x00' \
7991
 
-            '\x34\xa3\x7b\x6e' '\x9e\xaa\x8d\x7f' \
7992
 
-            '\x9d\xf6\x0e\xb8' '\x03\x88\x16\xb3' \
7993
 
-            '\x96\x38\x00\x00' '\x00\x00\x00\x00'
7994
 
+        self.reply_bin_0 = b'\x01\x01\x5a\x73' b'\x00\x00\x00\x00' \
7995
 
+            b'\x34\xa3\x7b\x6e' b'\x9e\xaa\x8d\x7f' \
7996
 
+            b'\x9d\xf6\x0e\xb8' b'\x03\x88\x16\xb3' \
7997
 
+            b'\x96\x38\x00\x00' b'\x00\x00\x00\x00'
7998
 
 
7999
 
 
8000
 
     def testPackRequest0(self):
8001
 
-        bin = apply(request.QueryPointer._request.to_binary, (), self.req_args_0)
8002
 
+        bin = request.QueryPointer._request.to_binary(*(), **self.req_args_0)
8003
 
         try:
8004
 
             assert bin == self.req_bin_0
8005
 
         except AssertionError:
8006
 
@@ -1947,7 +1955,7 @@
8007
 
             raise AssertionError(args)
8008
 
 
8009
 
     def testPackReply0(self):
8010
 
-        bin = apply(request.QueryPointer._reply.to_binary, (), self.reply_args_0)
8011
 
+        bin = request.QueryPointer._reply.to_binary(*(), **self.reply_args_0)
8012
 
         try:
8013
 
             assert bin == self.reply_bin_0
8014
 
         except AssertionError:
8015
 
@@ -1972,26 +1980,26 @@
8016
 
             'window': 528148429,
8017
 
             'stop': 1808786083,
8018
 
             }
8019
 
-        self.req_bin_0 = '\x27\x00\x04\x00' '\xcd\xe7\x7a\x1f' \
8020
 
-            '\x7d\xa5\xc9\x7d' '\xa3\xe2\xcf\x6b'
8021
 
+        self.req_bin_0 = b'\x27\x00\x04\x00' b'\xcd\xe7\x7a\x1f' \
8022
 
+            b'\x7d\xa5\xc9\x7d' b'\xa3\xe2\xcf\x6b'
8023
 
 
8024
 
         self.reply_args_0 = {
8025
 
             'events': [{'y': -23108, 'x': -3461, 'time': 984326273}, {'y': -4096, 'x': -4908, 'time': 488459157}, {'y': -29782, 'x': -8325, 'time': 1162935901}, {'y': -26418, 'x': -10559, 'time': 275816904}, {'y': -3941, 'x': -2216, 'time': 656439277}],
8026
 
             'sequence_number': 42652,
8027
 
             }
8028
 
-        self.reply_bin_0 = '\x01\x00\x9c\xa6' '\x0a\x00\x00\x00' \
8029
 
-            '\x05\x00\x00\x00' '\x00\x00\x00\x00' \
8030
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8031
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8032
 
-            '\x81\xa0\xab\x3a' '\x7b\xf2\xbc\xa5' \
8033
 
-            '\x95\x4b\x1d\x1d' '\xd4\xec\x00\xf0' \
8034
 
-            '\x5d\xfe\x50\x45' '\x7b\xdf\xaa\x8b' \
8035
 
-            '\xc8\xa1\x70\x10' '\xc1\xd6\xce\x98' \
8036
 
-            '\xed\x77\x20\x27' '\x58\xf7\x9b\xf0'
8037
 
+        self.reply_bin_0 = b'\x01\x00\x9c\xa6' b'\x0a\x00\x00\x00' \
8038
 
+            b'\x05\x00\x00\x00' b'\x00\x00\x00\x00' \
8039
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8040
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8041
 
+            b'\x81\xa0\xab\x3a' b'\x7b\xf2\xbc\xa5' \
8042
 
+            b'\x95\x4b\x1d\x1d' b'\xd4\xec\x00\xf0' \
8043
 
+            b'\x5d\xfe\x50\x45' b'\x7b\xdf\xaa\x8b' \
8044
 
+            b'\xc8\xa1\x70\x10' b'\xc1\xd6\xce\x98' \
8045
 
+            b'\xed\x77\x20\x27' b'\x58\xf7\x9b\xf0'
8046
 
 
8047
 
 
8048
 
     def testPackRequest0(self):
8049
 
-        bin = apply(request.GetMotionEvents._request.to_binary, (), self.req_args_0)
8050
 
+        bin = request.GetMotionEvents._request.to_binary(*(), **self.req_args_0)
8051
 
         try:
8052
 
             assert bin == self.req_bin_0
8053
 
         except AssertionError:
8054
 
@@ -2009,7 +2017,7 @@
8055
 
             raise AssertionError(args)
8056
 
 
8057
 
     def testPackReply0(self):
8058
 
-        bin = apply(request.GetMotionEvents._reply.to_binary, (), self.reply_args_0)
8059
 
+        bin = request.GetMotionEvents._reply.to_binary(*(), **self.reply_args_0)
8060
 
         try:
8061
 
             assert bin == self.reply_bin_0
8062
 
         except AssertionError:
8063
 
@@ -2035,8 +2043,8 @@
8064
 
             'src_x': -18176,
8065
 
             'src_y': -309,
8066
 
             }
8067
 
-        self.req_bin_0 = '\x28\x00\x04\x00' '\x8d\xc6\x9e\x4a' \
8068
 
-            '\xf0\x4f\xaa\x0e' '\x00\xb9\xcb\xfe'
8069
 
+        self.req_bin_0 = b'\x28\x00\x04\x00' b'\x8d\xc6\x9e\x4a' \
8070
 
+            b'\xf0\x4f\xaa\x0e' b'\x00\xb9\xcb\xfe'
8071
 
 
8072
 
         self.reply_args_0 = {
8073
 
             'y': -24269,
8074
 
@@ -2045,14 +2053,14 @@
8075
 
             'same_screen': 0,
8076
 
             'child': 1548917071,
8077
 
             }
8078
 
-        self.reply_bin_0 = '\x01\x00\x5b\x9a' '\x00\x00\x00\x00' \
8079
 
-            '\x4f\x99\x52\x5c' '\xca\x8b\x33\xa1' \
8080
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8081
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
8082
 
+        self.reply_bin_0 = b'\x01\x00\x5b\x9a' b'\x00\x00\x00\x00' \
8083
 
+            b'\x4f\x99\x52\x5c' b'\xca\x8b\x33\xa1' \
8084
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8085
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
8086
 
 
8087
 
 
8088
 
     def testPackRequest0(self):
8089
 
-        bin = apply(request.TranslateCoords._request.to_binary, (), self.req_args_0)
8090
 
+        bin = request.TranslateCoords._request.to_binary(*(), **self.req_args_0)
8091
 
         try:
8092
 
             assert bin == self.req_bin_0
8093
 
         except AssertionError:
8094
 
@@ -2070,7 +2078,7 @@
8095
 
             raise AssertionError(args)
8096
 
 
8097
 
     def testPackReply0(self):
8098
 
-        bin = apply(request.TranslateCoords._reply.to_binary, (), self.reply_args_0)
8099
 
+        bin = request.TranslateCoords._reply.to_binary(*(), **self.reply_args_0)
8100
 
         try:
8101
 
             assert bin == self.reply_bin_0
8102
 
         except AssertionError:
8103
 
@@ -2100,13 +2108,13 @@
8104
 
             'dst_window': 2139748563,
8105
 
             'src_window': 1945176770,
8106
 
             }
8107
 
-        self.req_bin_0 = '\x29\x00\x06\x00' '\xc2\x0a\xf1\x73' \
8108
 
-            '\xd3\xf8\x89\x7f' '\xd6\xfa\x4a\xcc' \
8109
 
-            '\x49\xb0\x03\x21' '\x62\xc3\xf7\x99'
8110
 
+        self.req_bin_0 = b'\x29\x00\x06\x00' b'\xc2\x0a\xf1\x73' \
8111
 
+            b'\xd3\xf8\x89\x7f' b'\xd6\xfa\x4a\xcc' \
8112
 
+            b'\x49\xb0\x03\x21' b'\x62\xc3\xf7\x99'
8113
 
 
8114
 
 
8115
 
     def testPackRequest0(self):
8116
 
-        bin = apply(request.WarpPointer._request.to_binary, (), self.req_args_0)
8117
 
+        bin = request.WarpPointer._request.to_binary(*(), **self.req_args_0)
8118
 
         try:
8119
 
             assert bin == self.req_bin_0
8120
 
         except AssertionError:
8121
 
@@ -2131,12 +2139,12 @@
8122
 
             'focus': 1068495705,
8123
 
             'time': 342883486,
8124
 
             }
8125
 
-        self.req_bin_0 = '\x2a\x00\x03\x00' '\x59\xf3\xaf\x3f' \
8126
 
-            '\x9e\xfc\x6f\x14'
8127
 
+        self.req_bin_0 = b'\x2a\x00\x03\x00' b'\x59\xf3\xaf\x3f' \
8128
 
+            b'\x9e\xfc\x6f\x14'
8129
 
 
8130
 
 
8131
 
     def testPackRequest0(self):
8132
 
-        bin = apply(request.SetInputFocus._request.to_binary, (), self.req_args_0)
8133
 
+        bin = request.SetInputFocus._request.to_binary(*(), **self.req_args_0)
8134
 
         try:
8135
 
             assert bin == self.req_bin_0
8136
 
         except AssertionError:
8137
 
@@ -2158,21 +2166,21 @@
8138
 
     def setUp(self):
8139
 
         self.req_args_0 = {
8140
 
             }
8141
 
-        self.req_bin_0 = '\x2b\x00\x01\x00'
8142
 
+        self.req_bin_0 = b'\x2b\x00\x01\x00'
8143
 
 
8144
 
         self.reply_args_0 = {
8145
 
             'revert_to': 129,
8146
 
             'focus': 1884243837,
8147
 
             'sequence_number': 9052,
8148
 
             }
8149
 
-        self.reply_bin_0 = '\x01\x81\x5c\x23' '\x00\x00\x00\x00' \
8150
 
-            '\x7d\x47\x4f\x70' '\x00\x00\x00\x00' \
8151
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8152
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
8153
 
+        self.reply_bin_0 = b'\x01\x81\x5c\x23' b'\x00\x00\x00\x00' \
8154
 
+            b'\x7d\x47\x4f\x70' b'\x00\x00\x00\x00' \
8155
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8156
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
8157
 
 
8158
 
 
8159
 
     def testPackRequest0(self):
8160
 
-        bin = apply(request.GetInputFocus._request.to_binary, (), self.req_args_0)
8161
 
+        bin = request.GetInputFocus._request.to_binary(*(), **self.req_args_0)
8162
 
         try:
8163
 
             assert bin == self.req_bin_0
8164
 
         except AssertionError:
8165
 
@@ -2190,7 +2198,7 @@
8166
 
             raise AssertionError(args)
8167
 
 
8168
 
     def testPackReply0(self):
8169
 
-        bin = apply(request.GetInputFocus._reply.to_binary, (), self.reply_args_0)
8170
 
+        bin = request.GetInputFocus._reply.to_binary(*(), **self.reply_args_0)
8171
 
         try:
8172
 
             assert bin == self.reply_bin_0
8173
 
         except AssertionError:
8174
 
@@ -2212,21 +2220,21 @@
8175
 
     def setUp(self):
8176
 
         self.req_args_0 = {
8177
 
             }
8178
 
-        self.req_bin_0 = '\x2c\x00\x01\x00'
8179
 
+        self.req_bin_0 = b'\x2c\x00\x01\x00'
8180
 
 
8181
 
         self.reply_args_0 = {
8182
 
             'map': [175, 212, 207, 139, 156, 192, 230, 219, 136, 198, 152, 156, 229, 233, 221, 209, 131, 229, 209, 249, 130, 189, 183, 135, 238, 149, 131, 204, 162, 229, 149, 246],
8183
 
             'sequence_number': 19383,
8184
 
             }
8185
 
-        self.reply_bin_0 = '\x01\x00\xb7\x4b' '\x02\x00\x00\x00' \
8186
 
-            '\xaf\xd4\xcf\x8b' '\x9c\xc0\xe6\xdb' \
8187
 
-            '\x88\xc6\x98\x9c' '\xe5\xe9\xdd\xd1' \
8188
 
-            '\x83\xe5\xd1\xf9' '\x82\xbd\xb7\x87' \
8189
 
-            '\xee\x95\x83\xcc' '\xa2\xe5\x95\xf6'
8190
 
+        self.reply_bin_0 = b'\x01\x00\xb7\x4b' b'\x02\x00\x00\x00' \
8191
 
+            b'\xaf\xd4\xcf\x8b' b'\x9c\xc0\xe6\xdb' \
8192
 
+            b'\x88\xc6\x98\x9c' b'\xe5\xe9\xdd\xd1' \
8193
 
+            b'\x83\xe5\xd1\xf9' b'\x82\xbd\xb7\x87' \
8194
 
+            b'\xee\x95\x83\xcc' b'\xa2\xe5\x95\xf6'
8195
 
 
8196
 
 
8197
 
     def testPackRequest0(self):
8198
 
-        bin = apply(request.QueryKeymap._request.to_binary, (), self.req_args_0)
8199
 
+        bin = request.QueryKeymap._request.to_binary(*(), **self.req_args_0)
8200
 
         try:
8201
 
             assert bin == self.req_bin_0
8202
 
         except AssertionError:
8203
 
@@ -2244,7 +2252,7 @@
8204
 
             raise AssertionError(args)
8205
 
 
8206
 
     def testPackReply0(self):
8207
 
-        bin = apply(request.QueryKeymap._reply.to_binary, (), self.reply_args_0)
8208
 
+        bin = request.QueryKeymap._reply.to_binary(*(), **self.reply_args_0)
8209
 
         try:
8210
 
             assert bin == self.reply_bin_0
8211
 
         except AssertionError:
8212
 
@@ -2268,13 +2276,13 @@
8213
 
             'name': 'foofont',
8214
 
             'fid': 1809550053,
8215
 
             }
8216
 
-        self.req_bin_0 = '\x2d\x00\x05\x00' '\xe5\x8a\xdb\x6b' \
8217
 
-            '\x07\x00\x00\x00' '\x66\x6f\x6f\x66' \
8218
 
-            '\x6f\x6e\x74\x00'
8219
 
+        self.req_bin_0 = b'\x2d\x00\x05\x00' b'\xe5\x8a\xdb\x6b' \
8220
 
+            b'\x07\x00\x00\x00' b'\x66\x6f\x6f\x66' \
8221
 
+            b'\x6f\x6e\x74\x00'
8222
 
 
8223
 
 
8224
 
     def testPackRequest0(self):
8225
 
-        bin = apply(request.OpenFont._request.to_binary, (), self.req_args_0)
8226
 
+        bin = request.OpenFont._request.to_binary(*(), **self.req_args_0)
8227
 
         try:
8228
 
             assert bin == self.req_bin_0
8229
 
         except AssertionError:
8230
 
@@ -2297,11 +2305,11 @@
8231
 
         self.req_args_0 = {
8232
 
             'font': 405865016,
8233
 
             }
8234
 
-        self.req_bin_0 = '\x2e\x00\x02\x00' '\x38\x02\x31\x18'
8235
 
+        self.req_bin_0 = b'\x2e\x00\x02\x00' b'\x38\x02\x31\x18'
8236
 
 
8237
 
 
8238
 
     def testPackRequest0(self):
8239
 
-        bin = apply(request.CloseFont._request.to_binary, (), self.req_args_0)
8240
 
+        bin = request.CloseFont._request.to_binary(*(), **self.req_args_0)
8241
 
         try:
8242
 
             assert bin == self.req_bin_0
8243
 
         except AssertionError:
8244
 
@@ -2324,7 +2332,7 @@
8245
 
         self.req_args_0 = {
8246
 
             'font': 173413537,
8247
 
             }
8248
 
-        self.req_bin_0 = '\x2f\x00\x02\x00' '\xa1\x14\x56\x0a'
8249
 
+        self.req_bin_0 = b'\x2f\x00\x02\x00' b'\xa1\x14\x56\x0a'
8250
 
 
8251
 
         self.reply_args_0 = {
8252
 
             'max_bounds': {'left_side_bearing': -27346, 'descent': -13574, 'right_side_bearing': -29649, 'attributes': 58157, 'character_width': -6055, 'ascent': -4810},
8253
 
@@ -2342,23 +2350,23 @@
8254
 
             'properties': [{'name': 515636466, 'value': 1798456662}],
8255
 
             'sequence_number': 52469,
8256
 
             }
8257
 
-        self.reply_bin_0 = '\x01\x00\xf5\xcc' '\x12\x00\x00\x00' \
8258
 
-            '\x29\xe0\xf8\x83' '\x64\xb3\x6c\xd9' \
8259
 
-            '\x6d\x8f\xba\xcd' '\x00\x00\x00\x00' \
8260
 
-            '\x2e\x95\x2f\x8c' '\x59\xe8\x36\xed' \
8261
 
-            '\xfa\xca\x2d\xe3' '\x00\x00\x00\x00' \
8262
 
-            '\x08\xd1\x0a\xbd' '\x13\x6f\x01\x00' \
8263
 
-            '\xa5\xc3\xdb\x00' '\x1a\xc2\x6f\xfc' \
8264
 
-            '\x03\x00\x00\x00' '\xf2\xfc\xbb\x1e' \
8265
 
-            '\x56\x45\x32\x6b' '\xfe\xae\x3f\xf5' \
8266
 
-            '\x3d\xd0\xc7\xc9' '\x40\xc4\xfb\xfb' \
8267
 
-            '\xfe\xd5\x51\xda' '\x09\x97\x23\xd4' \
8268
 
-            '\xa7\xf9\xa8\x74' '\x8e\x87\xaf\x93' \
8269
 
-            '\x65\xef\x49\xd0' '\x50\xbe\x82\xde'
8270
 
+        self.reply_bin_0 = b'\x01\x00\xf5\xcc' b'\x12\x00\x00\x00' \
8271
 
+            b'\x29\xe0\xf8\x83' b'\x64\xb3\x6c\xd9' \
8272
 
+            b'\x6d\x8f\xba\xcd' b'\x00\x00\x00\x00' \
8273
 
+            b'\x2e\x95\x2f\x8c' b'\x59\xe8\x36\xed' \
8274
 
+            b'\xfa\xca\x2d\xe3' b'\x00\x00\x00\x00' \
8275
 
+            b'\x08\xd1\x0a\xbd' b'\x13\x6f\x01\x00' \
8276
 
+            b'\xa5\xc3\xdb\x00' b'\x1a\xc2\x6f\xfc' \
8277
 
+            b'\x03\x00\x00\x00' b'\xf2\xfc\xbb\x1e' \
8278
 
+            b'\x56\x45\x32\x6b' b'\xfe\xae\x3f\xf5' \
8279
 
+            b'\x3d\xd0\xc7\xc9' b'\x40\xc4\xfb\xfb' \
8280
 
+            b'\xfe\xd5\x51\xda' b'\x09\x97\x23\xd4' \
8281
 
+            b'\xa7\xf9\xa8\x74' b'\x8e\x87\xaf\x93' \
8282
 
+            b'\x65\xef\x49\xd0' b'\x50\xbe\x82\xde'
8283
 
 
8284
 
 
8285
 
     def testPackRequest0(self):
8286
 
-        bin = apply(request.QueryFont._request.to_binary, (), self.req_args_0)
8287
 
+        bin = request.QueryFont._request.to_binary(*(), **self.req_args_0)
8288
 
         try:
8289
 
             assert bin == self.req_bin_0
8290
 
         except AssertionError:
8291
 
@@ -2376,7 +2384,7 @@
8292
 
             raise AssertionError(args)
8293
 
 
8294
 
     def testPackReply0(self):
8295
 
-        bin = apply(request.QueryFont._reply.to_binary, (), self.reply_args_0)
8296
 
+        bin = request.QueryFont._reply.to_binary(*(), **self.reply_args_0)
8297
 
         try:
8298
 
             assert bin == self.reply_bin_0
8299
 
         except AssertionError:
8300
 
@@ -2400,8 +2408,8 @@
8301
 
             'font': 1637171782,
8302
 
             'string': (102, 111, 111),
8303
 
             }
8304
 
-        self.req_bin_0 = '\x30\x01\x04\x00' '\x46\x42\x95\x61' \
8305
 
-            '\x00\x66\x00\x6f' '\x00\x6f\x00\x00'
8306
 
+        self.req_bin_0 = b'\x30\x01\x04\x00' b'\x46\x42\x95\x61' \
8307
 
+            b'\x00\x66\x00\x6f' b'\x00\x6f\x00\x00'
8308
 
 
8309
 
         self.reply_args_0 = {
8310
 
             'font_descent': -10581,
8311
 
@@ -2414,14 +2422,14 @@
8312
 
             'sequence_number': 6206,
8313
 
             'overall_width': -127705892,
8314
 
             }
8315
 
-        self.reply_bin_0 = '\x01\xc3\x3e\x18' '\x00\x00\x00\x00' \
8316
 
-            '\x45\xa6\xab\xd6' '\x72\x80\x6a\xb2' \
8317
 
-            '\xdc\x5c\x63\xf8' '\x65\x3c\xb5\xb7' \
8318
 
-            '\x9a\xb2\x7c\xcf' '\x00\x00\x00\x00'
8319
 
+        self.reply_bin_0 = b'\x01\xc3\x3e\x18' b'\x00\x00\x00\x00' \
8320
 
+            b'\x45\xa6\xab\xd6' b'\x72\x80\x6a\xb2' \
8321
 
+            b'\xdc\x5c\x63\xf8' b'\x65\x3c\xb5\xb7' \
8322
 
+            b'\x9a\xb2\x7c\xcf' b'\x00\x00\x00\x00'
8323
 
 
8324
 
 
8325
 
     def testPackRequest0(self):
8326
 
-        bin = apply(request.QueryTextExtents._request.to_binary, (), self.req_args_0)
8327
 
+        bin = request.QueryTextExtents._request.to_binary(*(), **self.req_args_0)
8328
 
         try:
8329
 
             assert bin == self.req_bin_0
8330
 
         except AssertionError:
8331
 
@@ -2439,7 +2447,7 @@
8332
 
             raise AssertionError(args)
8333
 
 
8334
 
     def testPackReply0(self):
8335
 
-        bin = apply(request.QueryTextExtents._reply.to_binary, (), self.reply_args_0)
8336
 
+        bin = request.QueryTextExtents._reply.to_binary(*(), **self.reply_args_0)
8337
 
         try:
8338
 
             assert bin == self.reply_bin_0
8339
 
         except AssertionError:
8340
 
@@ -2463,24 +2471,24 @@
8341
 
             'pattern': 'bhazr',
8342
 
             'max_names': 57427,
8343
 
             }
8344
 
-        self.req_bin_0 = '\x31\x00\x04\x00' '\x53\xe0\x05\x00' \
8345
 
-            '\x62\x68\x61\x7a' '\x72\x00\x00\x00'
8346
 
+        self.req_bin_0 = b'\x31\x00\x04\x00' b'\x53\xe0\x05\x00' \
8347
 
+            b'\x62\x68\x61\x7a' b'\x72\x00\x00\x00'
8348
 
 
8349
 
         self.reply_args_0 = {
8350
 
             'fonts': ['fie', 'fuzzy', 'foozooom'],
8351
 
             'sequence_number': 39409,
8352
 
             }
8353
 
-        self.reply_bin_0 = '\x01\x00\xf1\x99' '\x05\x00\x00\x00' \
8354
 
-            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
8355
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8356
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8357
 
-            '\x03\x66\x69\x65' '\x05\x66\x75\x7a' \
8358
 
-            '\x7a\x79\x08\x66' '\x6f\x6f\x7a\x6f' \
8359
 
-            '\x6f\x6f\x6d\x00'
8360
 
+        self.reply_bin_0 = b'\x01\x00\xf1\x99' b'\x05\x00\x00\x00' \
8361
 
+            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
8362
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8363
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8364
 
+            b'\x03\x66\x69\x65' b'\x05\x66\x75\x7a' \
8365
 
+            b'\x7a\x79\x08\x66' b'\x6f\x6f\x7a\x6f' \
8366
 
+            b'\x6f\x6f\x6d\x00'
8367
 
 
8368
 
 
8369
 
     def testPackRequest0(self):
8370
 
-        bin = apply(request.ListFonts._request.to_binary, (), self.req_args_0)
8371
 
+        bin = request.ListFonts._request.to_binary(*(), **self.req_args_0)
8372
 
         try:
8373
 
             assert bin == self.req_bin_0
8374
 
         except AssertionError:
8375
 
@@ -2498,7 +2506,7 @@
8376
 
             raise AssertionError(args)
8377
 
 
8378
 
     def testPackReply0(self):
8379
 
-        bin = apply(request.ListFonts._reply.to_binary, (), self.reply_args_0)
8380
 
+        bin = request.ListFonts._reply.to_binary(*(), **self.reply_args_0)
8381
 
         try:
8382
 
             assert bin == self.reply_bin_0
8383
 
         except AssertionError:
8384
 
@@ -2522,8 +2530,8 @@
8385
 
             'pattern': 'bhazr2',
8386
 
             'max_names': 52288,
8387
 
             }
8388
 
-        self.req_bin_0 = '\x32\x00\x04\x00' '\x40\xcc\x06\x00' \
8389
 
-            '\x62\x68\x61\x7a' '\x72\x32\x00\x00'
8390
 
+        self.req_bin_0 = b'\x32\x00\x04\x00' b'\x40\xcc\x06\x00' \
8391
 
+            b'\x62\x68\x61\x7a' b'\x72\x32\x00\x00'
8392
 
 
8393
 
         self.reply_args_0 = {
8394
 
             'max_bounds': {'left_side_bearing': -9255, 'descent': -26305, 'right_side_bearing': -6756, 'attributes': 49084, 'character_width': -4462, 'ascent': -3529},
8395
 
@@ -2542,20 +2550,20 @@
8396
 
             'properties': [{'name': 213588122, 'value': 1789263183}],
8397
 
             'sequence_number': 43812,
8398
 
             }
8399
 
-        self.reply_bin_0 = '\x01\x08\x24\xab' '\x0b\x00\x00\x00' \
8400
 
-            '\x62\xdf\x86\xb3' '\x5f\xae\x0c\xd9' \
8401
 
-            '\xc4\xbd\xd8\x6a' '\x00\x00\x00\x00' \
8402
 
-            '\xd9\xdb\x9c\xe5' '\x92\xee\x37\xf2' \
8403
 
-            '\x3f\x99\xbc\xbf' '\x00\x00\x00\x00' \
8404
 
-            '\x45\xfe\x72\xb0' '\x6b\x98\x01\x00' \
8405
 
-            '\xe5\x9e\xdd\x01' '\xce\x96\x37\x9e' \
8406
 
-            '\x27\x6f\x9c\x68' '\x9a\x18\xbb\x0c' \
8407
 
-            '\x4f\xfd\xa5\x6a' '\x66\x6f\x6e\x74' \
8408
 
-            '\x66\x6f\x6e\x74'
8409
 
+        self.reply_bin_0 = b'\x01\x08\x24\xab' b'\x0b\x00\x00\x00' \
8410
 
+            b'\x62\xdf\x86\xb3' b'\x5f\xae\x0c\xd9' \
8411
 
+            b'\xc4\xbd\xd8\x6a' b'\x00\x00\x00\x00' \
8412
 
+            b'\xd9\xdb\x9c\xe5' b'\x92\xee\x37\xf2' \
8413
 
+            b'\x3f\x99\xbc\xbf' b'\x00\x00\x00\x00' \
8414
 
+            b'\x45\xfe\x72\xb0' b'\x6b\x98\x01\x00' \
8415
 
+            b'\xe5\x9e\xdd\x01' b'\xce\x96\x37\x9e' \
8416
 
+            b'\x27\x6f\x9c\x68' b'\x9a\x18\xbb\x0c' \
8417
 
+            b'\x4f\xfd\xa5\x6a' b'\x66\x6f\x6e\x74' \
8418
 
+            b'\x66\x6f\x6e\x74'
8419
 
 
8420
 
 
8421
 
     def testPackRequest0(self):
8422
 
-        bin = apply(request.ListFontsWithInfo._request.to_binary, (), self.req_args_0)
8423
 
+        bin = request.ListFontsWithInfo._request.to_binary(*(), **self.req_args_0)
8424
 
         try:
8425
 
             assert bin == self.req_bin_0
8426
 
         except AssertionError:
8427
 
@@ -2573,7 +2581,7 @@
8428
 
             raise AssertionError(args)
8429
 
 
8430
 
     def testPackReply0(self):
8431
 
-        bin = apply(request.ListFontsWithInfo._reply.to_binary, (), self.reply_args_0)
8432
 
+        bin = request.ListFontsWithInfo._reply.to_binary(*(), **self.reply_args_0)
8433
 
         try:
8434
 
             assert bin == self.reply_bin_0
8435
 
         except AssertionError:
8436
 
@@ -2596,18 +2604,18 @@
8437
 
         self.req_args_0 = {
8438
 
             'path': ['foo', 'bar', 'gazonk'],
8439
 
             }
8440
 
-        self.req_bin_0 = '\x33\x00\x06\x00' '\x03\x00\x00\x00' \
8441
 
-            '\x03\x66\x6f\x6f' '\x03\x62\x61\x72' \
8442
 
-            '\x06\x67\x61\x7a' '\x6f\x6e\x6b\x00'
8443
 
+        self.req_bin_0 = b'\x33\x00\x06\x00' b'\x03\x00\x00\x00' \
8444
 
+            b'\x03\x66\x6f\x6f' b'\x03\x62\x61\x72' \
8445
 
+            b'\x06\x67\x61\x7a' b'\x6f\x6e\x6b\x00'
8446
 
 
8447
 
         self.req_args_1 = {
8448
 
             'path': [],
8449
 
             }
8450
 
-        self.req_bin_1 = '\x33\x00\x02\x00' '\x00\x00\x00\x00'
8451
 
+        self.req_bin_1 = b'\x33\x00\x02\x00' b'\x00\x00\x00\x00'
8452
 
 
8453
 
 
8454
 
     def testPackRequest0(self):
8455
 
-        bin = apply(request.SetFontPath._request.to_binary, (), self.req_args_0)
8456
 
+        bin = request.SetFontPath._request.to_binary(*(), **self.req_args_0)
8457
 
         try:
8458
 
             assert bin == self.req_bin_0
8459
 
         except AssertionError:
8460
 
@@ -2625,7 +2633,7 @@
8461
 
             raise AssertionError(args)
8462
 
 
8463
 
     def testPackRequest1(self):
8464
 
-        bin = apply(request.SetFontPath._request.to_binary, (), self.req_args_1)
8465
 
+        bin = request.SetFontPath._request.to_binary(*(), **self.req_args_1)
8466
 
         try:
8467
 
             assert bin == self.req_bin_1
8468
 
         except AssertionError:
8469
 
@@ -2647,31 +2655,31 @@
8470
 
     def setUp(self):
8471
 
         self.req_args_0 = {
8472
 
             }
8473
 
-        self.req_bin_0 = '\x34\x00\x01\x00'
8474
 
+        self.req_bin_0 = b'\x34\x00\x01\x00'
8475
 
 
8476
 
         self.reply_args_0 = {
8477
 
             'paths': ['path1', 'path2232'],
8478
 
             'sequence_number': 17086,
8479
 
             }
8480
 
-        self.reply_bin_0 = '\x01\x00\xbe\x42' '\x04\x00\x00\x00' \
8481
 
-            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
8482
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8483
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8484
 
-            '\x05\x70\x61\x74' '\x68\x31\x08\x70' \
8485
 
-            '\x61\x74\x68\x32' '\x32\x33\x32\x00'
8486
 
+        self.reply_bin_0 = b'\x01\x00\xbe\x42' b'\x04\x00\x00\x00' \
8487
 
+            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
8488
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8489
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8490
 
+            b'\x05\x70\x61\x74' b'\x68\x31\x08\x70' \
8491
 
+            b'\x61\x74\x68\x32' b'\x32\x33\x32\x00'
8492
 
 
8493
 
         self.reply_args_1 = {
8494
 
             'paths': [],
8495
 
             'sequence_number': 8511,
8496
 
             }
8497
 
-        self.reply_bin_1 = '\x01\x00\x3f\x21' '\x00\x00\x00\x00' \
8498
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8499
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8500
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
8501
 
+        self.reply_bin_1 = b'\x01\x00\x3f\x21' b'\x00\x00\x00\x00' \
8502
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8503
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8504
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
8505
 
 
8506
 
 
8507
 
     def testPackRequest0(self):
8508
 
-        bin = apply(request.GetFontPath._request.to_binary, (), self.req_args_0)
8509
 
+        bin = request.GetFontPath._request.to_binary(*(), **self.req_args_0)
8510
 
         try:
8511
 
             assert bin == self.req_bin_0
8512
 
         except AssertionError:
8513
 
@@ -2689,7 +2697,7 @@
8514
 
             raise AssertionError(args)
8515
 
 
8516
 
     def testPackReply0(self):
8517
 
-        bin = apply(request.GetFontPath._reply.to_binary, (), self.reply_args_0)
8518
 
+        bin = request.GetFontPath._reply.to_binary(*(), **self.reply_args_0)
8519
 
         try:
8520
 
             assert bin == self.reply_bin_0
8521
 
         except AssertionError:
8522
 
@@ -2707,7 +2715,7 @@
8523
 
             raise AssertionError(args)
8524
 
 
8525
 
     def testPackReply1(self):
8526
 
-        bin = apply(request.GetFontPath._reply.to_binary, (), self.reply_args_1)
8527
 
+        bin = request.GetFontPath._reply.to_binary(*(), **self.reply_args_1)
8528
 
         try:
8529
 
             assert bin == self.reply_bin_1
8530
 
         except AssertionError:
8531
 
@@ -2734,12 +2742,12 @@
8532
 
             'drawable': 1358709134,
8533
 
             'height': 16464,
8534
 
             }
8535
 
-        self.req_bin_0 = '\x35\xb3\x04\x00' '\x4a\xd5\x85\x32' \
8536
 
-            '\x8e\x41\xfc\x50' '\x4c\x7e\x50\x40'
8537
 
+        self.req_bin_0 = b'\x35\xb3\x04\x00' b'\x4a\xd5\x85\x32' \
8538
 
+            b'\x8e\x41\xfc\x50' b'\x4c\x7e\x50\x40'
8539
 
 
8540
 
 
8541
 
     def testPackRequest0(self):
8542
 
-        bin = apply(request.CreatePixmap._request.to_binary, (), self.req_args_0)
8543
 
+        bin = request.CreatePixmap._request.to_binary(*(), **self.req_args_0)
8544
 
         try:
8545
 
             assert bin == self.req_bin_0
8546
 
         except AssertionError:
8547
 
@@ -2762,11 +2770,11 @@
8548
 
         self.req_args_0 = {
8549
 
             'pixmap': 1323266674,
8550
 
             }
8551
 
-        self.req_bin_0 = '\x36\x00\x02\x00' '\x72\x72\xdf\x4e'
8552
 
+        self.req_bin_0 = b'\x36\x00\x02\x00' b'\x72\x72\xdf\x4e'
8553
 
 
8554
 
 
8555
 
     def testPackRequest0(self):
8556
 
-        bin = apply(request.FreePixmap._request.to_binary, (), self.req_args_0)
8557
 
+        bin = request.FreePixmap._request.to_binary(*(), **self.req_args_0)
8558
 
         try:
8559
 
             assert bin == self.req_bin_0
8560
 
         except AssertionError:
8561
 
@@ -2791,24 +2799,24 @@
8562
 
             'attrs': {'function': 14, 'foreground': 814230008, 'background': 2072616911, 'clip_x_origin': -6987, 'subwindow_mode': 0, 'cap_style': 1, 'fill_style': 3, 'tile_stipple_y_origin': -25870, 'font': 264499208, 'graphics_exposures': 0, 'join_style': 2, 'line_width': 36600, 'stipple': 870974399, 'dash_offset': 49599, 'clip_y_origin': -5712, 'tile_stipple_x_origin': -32365, 'arc_mode': 0, 'tile': 1597988019, 'line_style': 2, 'plane_mask': 1650697305, 'clip_mask': 402937862, 'fill_rule': 0, 'dashes': 136},
8563
 
             'cid': 779296774,
8564
 
             }
8565
 
-        self.req_bin_0 = '\x37\x00\x1b\x00' '\x06\x20\x73\x2e' \
8566
 
-            '\xb2\x9b\x7c\x31' '\xff\xff\x7f\x00' \
8567
 
-            '\x0e\x00\x00\x00' '\x59\xa4\x63\x62' \
8568
 
-            '\xf8\x29\x88\x30' '\xcf\x9f\x89\x7b' \
8569
 
-            '\xf8\x8e\x00\x00' '\x02\x00\x00\x00' \
8570
 
-            '\x01\x00\x00\x00' '\x02\x00\x00\x00' \
8571
 
-            '\x03\x00\x00\x00' '\x00\x00\x00\x00' \
8572
 
-            '\xb3\x5c\x3f\x5f' '\xbf\x03\xea\x33' \
8573
 
-            '\x93\x81\x00\x00' '\xf2\x9a\x00\x00' \
8574
 
-            '\x08\xf0\xc3\x0f' '\x00\x00\x00\x00' \
8575
 
-            '\x00\x00\x00\x00' '\xb5\xe4\x00\x00' \
8576
 
-            '\xb0\xe9\x00\x00' '\x06\x58\x04\x18' \
8577
 
-            '\xbf\xc1\x00\x00' '\x88\x00\x00\x00' \
8578
 
-            '\x00\x00\x00\x00'
8579
 
+        self.req_bin_0 = b'\x37\x00\x1b\x00' b'\x06\x20\x73\x2e' \
8580
 
+            b'\xb2\x9b\x7c\x31' b'\xff\xff\x7f\x00' \
8581
 
+            b'\x0e\x00\x00\x00' b'\x59\xa4\x63\x62' \
8582
 
+            b'\xf8\x29\x88\x30' b'\xcf\x9f\x89\x7b' \
8583
 
+            b'\xf8\x8e\x00\x00' b'\x02\x00\x00\x00' \
8584
 
+            b'\x01\x00\x00\x00' b'\x02\x00\x00\x00' \
8585
 
+            b'\x03\x00\x00\x00' b'\x00\x00\x00\x00' \
8586
 
+            b'\xb3\x5c\x3f\x5f' b'\xbf\x03\xea\x33' \
8587
 
+            b'\x93\x81\x00\x00' b'\xf2\x9a\x00\x00' \
8588
 
+            b'\x08\xf0\xc3\x0f' b'\x00\x00\x00\x00' \
8589
 
+            b'\x00\x00\x00\x00' b'\xb5\xe4\x00\x00' \
8590
 
+            b'\xb0\xe9\x00\x00' b'\x06\x58\x04\x18' \
8591
 
+            b'\xbf\xc1\x00\x00' b'\x88\x00\x00\x00' \
8592
 
+            b'\x00\x00\x00\x00'
8593
 
 
8594
 
 
8595
 
     def testPackRequest0(self):
8596
 
-        bin = apply(request.CreateGC._request.to_binary, (), self.req_args_0)
8597
 
+        bin = request.CreateGC._request.to_binary(*(), **self.req_args_0)
8598
 
         try:
8599
 
             assert bin == self.req_bin_0
8600
 
         except AssertionError:
8601
 
@@ -2832,23 +2840,23 @@
8602
 
             'gc': 1996372624,
8603
 
             'attrs': {'function': 15, 'foreground': 1817174045, 'background': 840850119, 'clip_x_origin': -28415, 'subwindow_mode': 1, 'cap_style': 0, 'fill_style': 0, 'tile_stipple_y_origin': -24832, 'font': 240535139, 'graphics_exposures': 1, 'join_style': 2, 'line_width': 64290, 'stipple': 1739313208, 'dash_offset': 53189, 'clip_y_origin': -2802, 'tile_stipple_x_origin': -4548, 'arc_mode': 1, 'tile': 1091199324, 'line_style': 2, 'plane_mask': 1403123174, 'clip_mask': 1604118463, 'fill_rule': 1, 'dashes': 186},
8604
 
             }
8605
 
-        self.req_bin_0 = '\x38\x00\x1a\x00' '\x90\x3a\xfe\x76' \
8606
 
-            '\xff\xff\x7f\x00' '\x0f\x00\x00\x00' \
8607
 
-            '\xe6\xf5\xa1\x53' '\x1d\xe0\x4f\x6c' \
8608
 
-            '\xc7\x5a\x1e\x32' '\x22\xfb\x00\x00' \
8609
 
-            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
8610
 
-            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
8611
 
-            '\x01\x00\x00\x00' '\x5c\x61\x0a\x41' \
8612
 
-            '\x38\xd0\xab\x67' '\x3c\xee\x00\x00' \
8613
 
-            '\x00\x9f\x00\x00' '\x63\x46\x56\x0e' \
8614
 
-            '\x01\x00\x00\x00' '\x01\x00\x00\x00' \
8615
 
-            '\x01\x91\x00\x00' '\x0e\xf5\x00\x00' \
8616
 
-            '\xbf\xe7\x9c\x5f' '\xc5\xcf\x00\x00' \
8617
 
-            '\xba\x00\x00\x00' '\x01\x00\x00\x00'
8618
 
+        self.req_bin_0 = b'\x38\x00\x1a\x00' b'\x90\x3a\xfe\x76' \
8619
 
+            b'\xff\xff\x7f\x00' b'\x0f\x00\x00\x00' \
8620
 
+            b'\xe6\xf5\xa1\x53' b'\x1d\xe0\x4f\x6c' \
8621
 
+            b'\xc7\x5a\x1e\x32' b'\x22\xfb\x00\x00' \
8622
 
+            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
8623
 
+            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
8624
 
+            b'\x01\x00\x00\x00' b'\x5c\x61\x0a\x41' \
8625
 
+            b'\x38\xd0\xab\x67' b'\x3c\xee\x00\x00' \
8626
 
+            b'\x00\x9f\x00\x00' b'\x63\x46\x56\x0e' \
8627
 
+            b'\x01\x00\x00\x00' b'\x01\x00\x00\x00' \
8628
 
+            b'\x01\x91\x00\x00' b'\x0e\xf5\x00\x00' \
8629
 
+            b'\xbf\xe7\x9c\x5f' b'\xc5\xcf\x00\x00' \
8630
 
+            b'\xba\x00\x00\x00' b'\x01\x00\x00\x00'
8631
 
 
8632
 
 
8633
 
     def testPackRequest0(self):
8634
 
-        bin = apply(request.ChangeGC._request.to_binary, (), self.req_args_0)
8635
 
+        bin = request.ChangeGC._request.to_binary(*(), **self.req_args_0)
8636
 
         try:
8637
 
             assert bin == self.req_bin_0
8638
 
         except AssertionError:
8639
 
@@ -2873,12 +2881,12 @@
8640
 
             'dst_gc': 2046321491,
8641
 
             'mask': 996538407,
8642
 
             }
8643
 
-        self.req_bin_0 = '\x39\x00\x04\x00' '\x3a\x47\xae\x5f' \
8644
 
-            '\x53\x63\xf8\x79' '\x27\xf8\x65\x3b'
8645
 
+        self.req_bin_0 = b'\x39\x00\x04\x00' b'\x3a\x47\xae\x5f' \
8646
 
+            b'\x53\x63\xf8\x79' b'\x27\xf8\x65\x3b'
8647
 
 
8648
 
 
8649
 
     def testPackRequest0(self):
8650
 
-        bin = apply(request.CopyGC._request.to_binary, (), self.req_args_0)
8651
 
+        bin = request.CopyGC._request.to_binary(*(), **self.req_args_0)
8652
 
         try:
8653
 
             assert bin == self.req_bin_0
8654
 
         except AssertionError:
8655
 
@@ -2903,13 +2911,13 @@
8656
 
             'gc': 2119954025,
8657
 
             'dashes': [146, 217, 181, 229, 212, 175, 201, 251, 248],
8658
 
             }
8659
 
-        self.req_bin_0 = '\x3a\x00\x06\x00' '\x69\xee\x5b\x7e' \
8660
 
-            '\x8e\x88\x09\x00' '\x92\xd9\xb5\xe5' \
8661
 
-            '\xd4\xaf\xc9\xfb' '\xf8\x00\x00\x00'
8662
 
+        self.req_bin_0 = b'\x3a\x00\x06\x00' b'\x69\xee\x5b\x7e' \
8663
 
+            b'\x8e\x88\x09\x00' b'\x92\xd9\xb5\xe5' \
8664
 
+            b'\xd4\xaf\xc9\xfb' b'\xf8\x00\x00\x00'
8665
 
 
8666
 
 
8667
 
     def testPackRequest0(self):
8668
 
-        bin = apply(request.SetDashes._request.to_binary, (), self.req_args_0)
8669
 
+        bin = request.SetDashes._request.to_binary(*(), **self.req_args_0)
8670
 
         try:
8671
 
             assert bin == self.req_bin_0
8672
 
         except AssertionError:
8673
 
@@ -2936,10 +2944,10 @@
8674
 
             'rectangles': [{'y': -27524, 'x': -27245, 'height': 31014, 'width': 52432}, {'y': -8991, 'x': -11302, 'height': 9053, 'width': 11072}],
8675
 
             'x_origin': -26003,
8676
 
             }
8677
 
-        self.req_bin_0 = '\x3b\x03\x07\x00' '\xc6\x91\xed\x78' \
8678
 
-            '\x6d\x9a\x5e\xc3' '\x93\x95\x7c\x94' \
8679
 
-            '\xd0\xcc\x26\x79' '\xda\xd3\xe1\xdc' \
8680
 
-            '\x40\x2b\x5d\x23'
8681
 
+        self.req_bin_0 = b'\x3b\x03\x07\x00' b'\xc6\x91\xed\x78' \
8682
 
+            b'\x6d\x9a\x5e\xc3' b'\x93\x95\x7c\x94' \
8683
 
+            b'\xd0\xcc\x26\x79' b'\xda\xd3\xe1\xdc' \
8684
 
+            b'\x40\x2b\x5d\x23'
8685
 
 
8686
 
         self.req_args_1 = {
8687
 
             'ordering': 1,
8688
 
@@ -2948,12 +2956,12 @@
8689
 
             'rectangles': [],
8690
 
             'x_origin': -23382,
8691
 
             }
8692
 
-        self.req_bin_1 = '\x3b\x01\x03\x00' '\x8d\x63\x46\x09' \
8693
 
-            '\xaa\xa4\x4a\x80'
8694
 
+        self.req_bin_1 = b'\x3b\x01\x03\x00' b'\x8d\x63\x46\x09' \
8695
 
+            b'\xaa\xa4\x4a\x80'
8696
 
 
8697
 
 
8698
 
     def testPackRequest0(self):
8699
 
-        bin = apply(request.SetClipRectangles._request.to_binary, (), self.req_args_0)
8700
 
+        bin = request.SetClipRectangles._request.to_binary(*(), **self.req_args_0)
8701
 
         try:
8702
 
             assert bin == self.req_bin_0
8703
 
         except AssertionError:
8704
 
@@ -2971,7 +2979,7 @@
8705
 
             raise AssertionError(args)
8706
 
 
8707
 
     def testPackRequest1(self):
8708
 
-        bin = apply(request.SetClipRectangles._request.to_binary, (), self.req_args_1)
8709
 
+        bin = request.SetClipRectangles._request.to_binary(*(), **self.req_args_1)
8710
 
         try:
8711
 
             assert bin == self.req_bin_1
8712
 
         except AssertionError:
8713
 
@@ -2994,11 +3002,11 @@
8714
 
         self.req_args_0 = {
8715
 
             'gc': 533809208,
8716
 
             }
8717
 
-        self.req_bin_0 = '\x3c\x00\x02\x00' '\x38\x48\xd1\x1f'
8718
 
+        self.req_bin_0 = b'\x3c\x00\x02\x00' b'\x38\x48\xd1\x1f'
8719
 
 
8720
 
 
8721
 
     def testPackRequest0(self):
8722
 
-        bin = apply(request.FreeGC._request.to_binary, (), self.req_args_0)
8723
 
+        bin = request.FreeGC._request.to_binary(*(), **self.req_args_0)
8724
 
         try:
8725
 
             assert bin == self.req_bin_0
8726
 
         except AssertionError:
8727
 
@@ -3026,12 +3034,12 @@
8728
 
             'exposures': 0,
8729
 
             'height': 27400,
8730
 
             }
8731
 
-        self.req_bin_0 = '\x3d\x00\x04\x00' '\xcc\x01\xe5\x1a' \
8732
 
-            '\x61\x88\xdd\xe6' '\xd9\x61\x08\x6b'
8733
 
+        self.req_bin_0 = b'\x3d\x00\x04\x00' b'\xcc\x01\xe5\x1a' \
8734
 
+            b'\x61\x88\xdd\xe6' b'\xd9\x61\x08\x6b'
8735
 
 
8736
 
 
8737
 
     def testPackRequest0(self):
8738
 
-        bin = apply(request.ClearArea._request.to_binary, (), self.req_args_0)
8739
 
+        bin = request.ClearArea._request.to_binary(*(), **self.req_args_0)
8740
 
         try:
8741
 
             assert bin == self.req_bin_0
8742
 
         except AssertionError:
8743
 
@@ -3062,14 +3070,14 @@
8744
 
             'width': 46860,
8745
 
             'src_drawable': 197047820,
8746
 
             }
8747
 
-        self.req_bin_0 = '\x3e\x00\x07\x00' '\x0c\xb6\xbe\x0b' \
8748
 
-            '\xa6\x6a\x81\x5a' '\x46\x2c\x6e\x20' \
8749
 
-            '\x7d\xc5\x9c\x9d' '\x03\xf3\x20\xd8' \
8750
 
-            '\x0c\xb7\x01\xb7'
8751
 
+        self.req_bin_0 = b'\x3e\x00\x07\x00' b'\x0c\xb6\xbe\x0b' \
8752
 
+            b'\xa6\x6a\x81\x5a' b'\x46\x2c\x6e\x20' \
8753
 
+            b'\x7d\xc5\x9c\x9d' b'\x03\xf3\x20\xd8' \
8754
 
+            b'\x0c\xb7\x01\xb7'
8755
 
 
8756
 
 
8757
 
     def testPackRequest0(self):
8758
 
-        bin = apply(request.CopyArea._request.to_binary, (), self.req_args_0)
8759
 
+        bin = request.CopyArea._request.to_binary(*(), **self.req_args_0)
8760
 
         try:
8761
 
             assert bin == self.req_bin_0
8762
 
         except AssertionError:
8763
 
@@ -3101,14 +3109,14 @@
8764
 
             'width': 12445,
8765
 
             'src_drawable': 1825271175,
8766
 
             }
8767
 
-        self.req_bin_0 = '\x3f\x00\x08\x00' '\x87\x6d\xcb\x6c' \
8768
 
-            '\x2b\x09\x58\x25' '\x3c\xde\x31\x78' \
8769
 
-            '\xc3\xc2\x29\xa0' '\x0f\xbc\x31\x9f' \
8770
 
-            '\x9d\x30\x2c\x24' '\x82\x1b\x3a\x07'
8771
 
+        self.req_bin_0 = b'\x3f\x00\x08\x00' b'\x87\x6d\xcb\x6c' \
8772
 
+            b'\x2b\x09\x58\x25' b'\x3c\xde\x31\x78' \
8773
 
+            b'\xc3\xc2\x29\xa0' b'\x0f\xbc\x31\x9f' \
8774
 
+            b'\x9d\x30\x2c\x24' b'\x82\x1b\x3a\x07'
8775
 
 
8776
 
 
8777
 
     def testPackRequest0(self):
8778
 
-        bin = apply(request.CopyPlane._request.to_binary, (), self.req_args_0)
8779
 
+        bin = request.CopyPlane._request.to_binary(*(), **self.req_args_0)
8780
 
         try:
8781
 
             assert bin == self.req_bin_0
8782
 
         except AssertionError:
8783
 
@@ -3134,13 +3142,13 @@
8784
 
             'points': [{'y': -18047, 'x': -19763}, {'y': -5351, 'x': -20174}, {'y': -10573, 'x': -29362}],
8785
 
             'gc': 1752128743,
8786
 
             }
8787
 
-        self.req_bin_0 = '\x40\x00\x06\x00' '\x2b\xdd\x32\x43' \
8788
 
-            '\xe7\x5c\x6f\x68' '\xcd\xb2\x81\xb9' \
8789
 
-            '\x32\xb1\x19\xeb' '\x4e\x8d\xb3\xd6'
8790
 
+        self.req_bin_0 = b'\x40\x00\x06\x00' b'\x2b\xdd\x32\x43' \
8791
 
+            b'\xe7\x5c\x6f\x68' b'\xcd\xb2\x81\xb9' \
8792
 
+            b'\x32\xb1\x19\xeb' b'\x4e\x8d\xb3\xd6'
8793
 
 
8794
 
 
8795
 
     def testPackRequest0(self):
8796
 
-        bin = apply(request.PolyPoint._request.to_binary, (), self.req_args_0)
8797
 
+        bin = request.PolyPoint._request.to_binary(*(), **self.req_args_0)
8798
 
         try:
8799
 
             assert bin == self.req_bin_0
8800
 
         except AssertionError:
8801
 
@@ -3166,14 +3174,14 @@
8802
 
             'points': [{'y': -22360, 'x': -25237}, {'y': -21145, 'x': -28948}, {'y': -16928, 'x': -3515}, {'y': -25838, 'x': -12335}, {'y': -31134, 'x': -12944}],
8803
 
             'gc': 1308624032,
8804
 
             }
8805
 
-        self.req_bin_0 = '\x41\x01\x08\x00' '\x3f\xf4\xc1\x50' \
8806
 
-            '\xa0\x04\x00\x4e' '\x6b\x9d\xa8\xa8' \
8807
 
-            '\xec\x8e\x67\xad' '\x45\xf2\xe0\xbd' \
8808
 
-            '\xd1\xcf\x12\x9b' '\x70\xcd\x62\x86'
8809
 
+        self.req_bin_0 = b'\x41\x01\x08\x00' b'\x3f\xf4\xc1\x50' \
8810
 
+            b'\xa0\x04\x00\x4e' b'\x6b\x9d\xa8\xa8' \
8811
 
+            b'\xec\x8e\x67\xad' b'\x45\xf2\xe0\xbd' \
8812
 
+            b'\xd1\xcf\x12\x9b' b'\x70\xcd\x62\x86'
8813
 
 
8814
 
 
8815
 
     def testPackRequest0(self):
8816
 
-        bin = apply(request.PolyLine._request.to_binary, (), self.req_args_0)
8817
 
+        bin = request.PolyLine._request.to_binary(*(), **self.req_args_0)
8818
 
         try:
8819
 
             assert bin == self.req_bin_0
8820
 
         except AssertionError:
8821
 
@@ -3198,13 +3206,13 @@
8822
 
             'gc': 2022424938,
8823
 
             'drawable': 158182613,
8824
 
             }
8825
 
-        self.req_bin_0 = '\x42\x00\x05\x00' '\xd5\xac\x6d\x09' \
8826
 
-            '\x6a\xc1\x8b\x78' '\x37\xf7\xa8\xf3' \
8827
 
-            '\xed\xeb\x08\x97'
8828
 
+        self.req_bin_0 = b'\x42\x00\x05\x00' b'\xd5\xac\x6d\x09' \
8829
 
+            b'\x6a\xc1\x8b\x78' b'\x37\xf7\xa8\xf3' \
8830
 
+            b'\xed\xeb\x08\x97'
8831
 
 
8832
 
 
8833
 
     def testPackRequest0(self):
8834
 
-        bin = apply(request.PolySegment._request.to_binary, (), self.req_args_0)
8835
 
+        bin = request.PolySegment._request.to_binary(*(), **self.req_args_0)
8836
 
         try:
8837
 
             assert bin == self.req_bin_0
8838
 
         except AssertionError:
8839
 
@@ -3229,15 +3237,15 @@
8840
 
             'drawable': 2136753875,
8841
 
             'rectangles': [{'y': -29358, 'x': -6957, 'height': 19230, 'width': 32377}, {'y': -23694, 'x': -2777, 'height': 48827, 'width': 42548}, {'y': -22773, 'x': -12641, 'height': 9809, 'width': 30955}],
8842
 
             }
8843
 
-        self.req_bin_0 = '\x43\x00\x09\x00' '\xd3\x46\x5c\x7f' \
8844
 
-            '\x93\xd8\xc5\x3d' '\xd3\xe4\x52\x8d' \
8845
 
-            '\x79\x7e\x1e\x4b' '\x27\xf5\x72\xa3' \
8846
 
-            '\x34\xa6\xbb\xbe' '\x9f\xce\x0b\xa7' \
8847
 
-            '\xeb\x78\x51\x26'
8848
 
+        self.req_bin_0 = b'\x43\x00\x09\x00' b'\xd3\x46\x5c\x7f' \
8849
 
+            b'\x93\xd8\xc5\x3d' b'\xd3\xe4\x52\x8d' \
8850
 
+            b'\x79\x7e\x1e\x4b' b'\x27\xf5\x72\xa3' \
8851
 
+            b'\x34\xa6\xbb\xbe' b'\x9f\xce\x0b\xa7' \
8852
 
+            b'\xeb\x78\x51\x26'
8853
 
 
8854
 
 
8855
 
     def testPackRequest0(self):
8856
 
-        bin = apply(request.PolyRectangle._request.to_binary, (), self.req_args_0)
8857
 
+        bin = request.PolyRectangle._request.to_binary(*(), **self.req_args_0)
8858
 
         try:
8859
 
             assert bin == self.req_bin_0
8860
 
         except AssertionError:
8861
 
@@ -3262,16 +3270,16 @@
8862
 
             'gc': 956699423,
8863
 
             'arcs': [{'width': 36714, 'angle1': -22260, 'angle2': -28493, 'y': -394, 'x': -6756, 'height': 63498}, {'width': 31212, 'angle1': -5166, 'angle2': -19039, 'y': -11179, 'x': -20569, 'height': 27113}, {'width': 62033, 'angle1': -18595, 'angle2': -26291, 'y': -8396, 'x': -7987, 'height': 11428}],
8864
 
             }
8865
 
-        self.req_bin_0 = '\x44\x00\x0c\x00' '\x96\x82\x2c\x7b' \
8866
 
-            '\x1f\x13\x06\x39' '\x9c\xe5\x76\xfe' \
8867
 
-            '\x6a\x8f\x0a\xf8' '\x0c\xa9\xb3\x90' \
8868
 
-            '\xa7\xaf\x55\xd4' '\xec\x79\xe9\x69' \
8869
 
-            '\xd2\xeb\xa1\xb5' '\xcd\xe0\x34\xdf' \
8870
 
-            '\x51\xf2\xa4\x2c' '\x5d\xb7\x4d\x99'
8871
 
+        self.req_bin_0 = b'\x44\x00\x0c\x00' b'\x96\x82\x2c\x7b' \
8872
 
+            b'\x1f\x13\x06\x39' b'\x9c\xe5\x76\xfe' \
8873
 
+            b'\x6a\x8f\x0a\xf8' b'\x0c\xa9\xb3\x90' \
8874
 
+            b'\xa7\xaf\x55\xd4' b'\xec\x79\xe9\x69' \
8875
 
+            b'\xd2\xeb\xa1\xb5' b'\xcd\xe0\x34\xdf' \
8876
 
+            b'\x51\xf2\xa4\x2c' b'\x5d\xb7\x4d\x99'
8877
 
 
8878
 
 
8879
 
     def testPackRequest0(self):
8880
 
-        bin = apply(request.PolyArc._request.to_binary, (), self.req_args_0)
8881
 
+        bin = request.PolyArc._request.to_binary(*(), **self.req_args_0)
8882
 
         try:
8883
 
             assert bin == self.req_bin_0
8884
 
         except AssertionError:
8885
 
@@ -3298,14 +3306,14 @@
8886
 
             'gc': 112110920,
8887
 
             'shape': 0,
8888
 
             }
8889
 
-        self.req_bin_0 = '\x45\x00\x07\x00' '\x96\x94\x65\x1f' \
8890
 
-            '\x48\xad\xae\x06' '\x00\x01\x00\x00' \
8891
 
-            '\xd3\xd1\x03\xfd' '\x8d\xf8\x9b\xd5' \
8892
 
-            '\x2c\xfe\xf2\x8b'
8893
 
+        self.req_bin_0 = b'\x45\x00\x07\x00' b'\x96\x94\x65\x1f' \
8894
 
+            b'\x48\xad\xae\x06' b'\x00\x01\x00\x00' \
8895
 
+            b'\xd3\xd1\x03\xfd' b'\x8d\xf8\x9b\xd5' \
8896
 
+            b'\x2c\xfe\xf2\x8b'
8897
 
 
8898
 
 
8899
 
     def testPackRequest0(self):
8900
 
-        bin = apply(request.FillPoly._request.to_binary, (), self.req_args_0)
8901
 
+        bin = request.FillPoly._request.to_binary(*(), **self.req_args_0)
8902
 
         try:
8903
 
             assert bin == self.req_bin_0
8904
 
         except AssertionError:
8905
 
@@ -3330,14 +3338,14 @@
8906
 
             'drawable': 878946804,
8907
 
             'rectangles': [{'y': -29169, 'x': -18095, 'height': 15301, 'width': 12078}, {'y': -7148, 'x': -18997, 'height': 7501, 'width': 17120}],
8908
 
             }
8909
 
-        self.req_bin_0 = '\x46\x00\x07\x00' '\xf4\xa9\x63\x34' \
8910
 
-            '\x64\x38\xf1\x1b' '\x51\xb9\x0f\x8e' \
8911
 
-            '\x2e\x2f\xc5\x3b' '\xcb\xb5\x14\xe4' \
8912
 
-            '\xe0\x42\x4d\x1d'
8913
 
+        self.req_bin_0 = b'\x46\x00\x07\x00' b'\xf4\xa9\x63\x34' \
8914
 
+            b'\x64\x38\xf1\x1b' b'\x51\xb9\x0f\x8e' \
8915
 
+            b'\x2e\x2f\xc5\x3b' b'\xcb\xb5\x14\xe4' \
8916
 
+            b'\xe0\x42\x4d\x1d'
8917
 
 
8918
 
 
8919
 
     def testPackRequest0(self):
8920
 
-        bin = apply(request.PolyFillRectangle._request.to_binary, (), self.req_args_0)
8921
 
+        bin = request.PolyFillRectangle._request.to_binary(*(), **self.req_args_0)
8922
 
         try:
8923
 
             assert bin == self.req_bin_0
8924
 
         except AssertionError:
8925
 
@@ -3362,13 +3370,13 @@
8926
 
             'gc': 1256983120,
8927
 
             'arcs': [{'width': 62526, 'angle1': -17496, 'angle2': -20949, 'y': -21843, 'x': -31746, 'height': 59073}],
8928
 
             }
8929
 
-        self.req_bin_0 = '\x47\x00\x06\x00' '\x34\xfa\xab\x4c' \
8930
 
-            '\x50\x0a\xec\x4a' '\xfe\x83\xad\xaa' \
8931
 
-            '\x3e\xf4\xc1\xe6' '\xa8\xbb\x2b\xae'
8932
 
+        self.req_bin_0 = b'\x47\x00\x06\x00' b'\x34\xfa\xab\x4c' \
8933
 
+            b'\x50\x0a\xec\x4a' b'\xfe\x83\xad\xaa' \
8934
 
+            b'\x3e\xf4\xc1\xe6' b'\xa8\xbb\x2b\xae'
8935
 
 
8936
 
 
8937
 
     def testPackRequest0(self):
8938
 
-        bin = apply(request.PolyFillArc._request.to_binary, (), self.req_args_0)
8939
 
+        bin = request.PolyFillArc._request.to_binary(*(), **self.req_args_0)
8940
 
         try:
8941
 
             assert bin == self.req_bin_0
8942
 
         except AssertionError:
8943
 
@@ -3400,15 +3408,15 @@
8944
 
             'depth': 218,
8945
 
             'height': 16464,
8946
 
             }
8947
 
-        self.req_bin_0 = '\x48\x02\x09\x00' '\x1e\xd0\xc5\x37' \
8948
 
-            '\x3d\xb4\xbf\x6e' '\x58\x9a\x50\x40' \
8949
 
-            '\x1b\xdc\xc8\xb6' '\xde\xda\x00\x00' \
8950
 
-            '\x62\x69\x74\x20' '\x6d\x61\x70\x20' \
8951
 
-            '\x64\x61\x74\x61'
8952
 
+        self.req_bin_0 = b'\x48\x02\x09\x00' b'\x1e\xd0\xc5\x37' \
8953
 
+            b'\x3d\xb4\xbf\x6e' b'\x58\x9a\x50\x40' \
8954
 
+            b'\x1b\xdc\xc8\xb6' b'\xde\xda\x00\x00' \
8955
 
+            b'\x62\x69\x74\x20' b'\x6d\x61\x70\x20' \
8956
 
+            b'\x64\x61\x74\x61'
8957
 
 
8958
 
 
8959
 
     def testPackRequest0(self):
8960
 
-        bin = apply(request.PutImage._request.to_binary, (), self.req_args_0)
8961
 
+        bin = request.PutImage._request.to_binary(*(), **self.req_args_0)
8962
 
         try:
8963
 
             assert bin == self.req_bin_0
8964
 
         except AssertionError:
8965
 
@@ -3437,9 +3445,9 @@
8966
 
             'plane_mask': 849117586,
8967
 
             'height': 24480,
8968
 
             }
8969
 
-        self.req_bin_0 = '\x49\x01\x05\x00' '\x87\xf9\x81\x16' \
8970
 
-            '\x3f\x80\x7c\xf5' '\x49\xba\xa0\x5f' \
8971
 
-            '\x92\x81\x9c\x32'
8972
 
+        self.req_bin_0 = b'\x49\x01\x05\x00' b'\x87\xf9\x81\x16' \
8973
 
+            b'\x3f\x80\x7c\xf5' b'\x49\xba\xa0\x5f' \
8974
 
+            b'\x92\x81\x9c\x32'
8975
 
 
8976
 
         self.reply_args_0 = {
8977
 
             'depth': 249,
8978
 
@@ -3447,18 +3455,18 @@
8979
 
             'visual': 141686402,
8980
 
             'sequence_number': 47197,
8981
 
             }
8982
 
-        self.reply_bin_0 = '\x01\xf9\x5d\xb8' '\x07\x00\x00\x00' \
8983
 
-            '\x82\xf6\x71\x08' '\x00\x00\x00\x00' \
8984
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8985
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
8986
 
-            '\x74\x68\x69\x73' '\x20\x69\x73\x20' \
8987
 
-            '\x72\x65\x61\x6c' '\x20\x6c\x79\x20' \
8988
 
-            '\x69\x6d\x61\x67' '\x20\x65\x20\x62' \
8989
 
-            '\x2d\x6d\x61\x70'
8990
 
+        self.reply_bin_0 = b'\x01\xf9\x5d\xb8' b'\x07\x00\x00\x00' \
8991
 
+            b'\x82\xf6\x71\x08' b'\x00\x00\x00\x00' \
8992
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8993
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
8994
 
+            b'\x74\x68\x69\x73' b'\x20\x69\x73\x20' \
8995
 
+            b'\x72\x65\x61\x6c' b'\x20\x6c\x79\x20' \
8996
 
+            b'\x69\x6d\x61\x67' b'\x20\x65\x20\x62' \
8997
 
+            b'\x2d\x6d\x61\x70'
8998
 
 
8999
 
 
9000
 
     def testPackRequest0(self):
9001
 
-        bin = apply(request.GetImage._request.to_binary, (), self.req_args_0)
9002
 
+        bin = request.GetImage._request.to_binary(*(), **self.req_args_0)
9003
 
         try:
9004
 
             assert bin == self.req_bin_0
9005
 
         except AssertionError:
9006
 
@@ -3476,7 +3484,7 @@
9007
 
             raise AssertionError(args)
9008
 
 
9009
 
     def testPackReply0(self):
9010
 
-        bin = apply(request.GetImage._reply.to_binary, (), self.reply_args_0)
9011
 
+        bin = request.GetImage._reply.to_binary(*(), **self.reply_args_0)
9012
 
         try:
9013
 
             assert bin == self.reply_bin_0
9014
 
         except AssertionError:
9015
 
@@ -3503,14 +3511,14 @@
9016
 
             'gc': 1348241590,
9017
 
             'x': -27139,
9018
 
             }
9019
 
-        self.req_bin_0 = '\x4a\x00\x08\x00' '\x18\x69\x7f\x67' \
9020
 
-            '\xb6\x88\x5c\x50' '\xfd\x95\x84\xe4' \
9021
 
-            '\x03\x02\x7a\x6f' '\x6f\xff\x01\x02' \
9022
 
-            '\x03\x04\x02\x00' '\x69\x65\x00\x00'
9023
 
+        self.req_bin_0 = b'\x4a\x00\x08\x00' b'\x18\x69\x7f\x67' \
9024
 
+            b'\xb6\x88\x5c\x50' b'\xfd\x95\x84\xe4' \
9025
 
+            b'\x03\x02\x7a\x6f' b'\x6f\xff\x01\x02' \
9026
 
+            b'\x03\x04\x02\x00' b'\x69\x65\x00\x00'
9027
 
 
9028
 
 
9029
 
     def testPackRequest0(self):
9030
 
-        bin = apply(request.PolyText8._request.to_binary, (), self.req_args_0)
9031
 
+        bin = request.PolyText8._request.to_binary(*(), **self.req_args_0)
9032
 
         try:
9033
 
             assert bin == self.req_bin_0
9034
 
         except AssertionError:
9035
 
@@ -3537,14 +3545,14 @@
9036
 
             'gc': 327278878,
9037
 
             'x': -31319,
9038
 
             }
9039
 
-        self.req_bin_0 = '\x4b\x00\x07\x00' '\x50\x96\x80\x63' \
9040
 
-            '\x1e\xe1\x81\x13' '\xa9\x85\xd9\xd6' \
9041
 
-            '\x02\x02\x10\x23' '\x00\x12\xff\x01' \
9042
 
-            '\x02\x03\x04\x00'
9043
 
+        self.req_bin_0 = b'\x4b\x00\x07\x00' b'\x50\x96\x80\x63' \
9044
 
+            b'\x1e\xe1\x81\x13' b'\xa9\x85\xd9\xd6' \
9045
 
+            b'\x02\x02\x10\x23' b'\x00\x12\xff\x01' \
9046
 
+            b'\x02\x03\x04\x00'
9047
 
 
9048
 
 
9049
 
     def testPackRequest0(self):
9050
 
-        bin = apply(request.PolyText16._request.to_binary, (), self.req_args_0)
9051
 
+        bin = request.PolyText16._request.to_binary(*(), **self.req_args_0)
9052
 
         try:
9053
 
             assert bin == self.req_bin_0
9054
 
         except AssertionError:
9055
 
@@ -3571,13 +3579,13 @@
9056
 
             'gc': 581816261,
9057
 
             'string': 'showme',
9058
 
             }
9059
 
-        self.req_bin_0 = '\x4c\x06\x06\x00' '\x50\xb6\x0d\x7f' \
9060
 
-            '\xc5\xcf\xad\x22' '\xd3\xc4\x71\xf1' \
9061
 
-            '\x73\x68\x6f\x77' '\x6d\x65\x00\x00'
9062
 
+        self.req_bin_0 = b'\x4c\x06\x06\x00' b'\x50\xb6\x0d\x7f' \
9063
 
+            b'\xc5\xcf\xad\x22' b'\xd3\xc4\x71\xf1' \
9064
 
+            b'\x73\x68\x6f\x77' b'\x6d\x65\x00\x00'
9065
 
 
9066
 
 
9067
 
     def testPackRequest0(self):
9068
 
-        bin = apply(request.ImageText8._request.to_binary, (), self.req_args_0)
9069
 
+        bin = request.ImageText8._request.to_binary(*(), **self.req_args_0)
9070
 
         try:
9071
 
             assert bin == self.req_bin_0
9072
 
         except AssertionError:
9073
 
@@ -3604,14 +3612,14 @@
9074
 
             'gc': 145495998,
9075
 
             'string': (115, 104, 111, 119, 109, 111, 114, 101),
9076
 
             }
9077
 
-        self.req_bin_0 = '\x4d\x08\x08\x00' '\x96\xa8\xff\x55' \
9078
 
-            '\xbe\x17\xac\x08' '\xe1\xf4\xce\xfb' \
9079
 
-            '\x00\x73\x00\x68' '\x00\x6f\x00\x77' \
9080
 
-            '\x00\x6d\x00\x6f' '\x00\x72\x00\x65'
9081
 
+        self.req_bin_0 = b'\x4d\x08\x08\x00' b'\x96\xa8\xff\x55' \
9082
 
+            b'\xbe\x17\xac\x08' b'\xe1\xf4\xce\xfb' \
9083
 
+            b'\x00\x73\x00\x68' b'\x00\x6f\x00\x77' \
9084
 
+            b'\x00\x6d\x00\x6f' b'\x00\x72\x00\x65'
9085
 
 
9086
 
 
9087
 
     def testPackRequest0(self):
9088
 
-        bin = apply(request.ImageText16._request.to_binary, (), self.req_args_0)
9089
 
+        bin = request.ImageText16._request.to_binary(*(), **self.req_args_0)
9090
 
         try:
9091
 
             assert bin == self.req_bin_0
9092
 
         except AssertionError:
9093
 
@@ -3637,12 +3645,12 @@
9094
 
             'visual': 1165319270,
9095
 
             'mid': 1982619692,
9096
 
             }
9097
 
-        self.req_bin_0 = '\x4e\x00\x04\x00' '\x2c\x60\x2c\x76' \
9098
 
-            '\xc5\x34\xa3\x52' '\x66\x5c\x75\x45'
9099
 
+        self.req_bin_0 = b'\x4e\x00\x04\x00' b'\x2c\x60\x2c\x76' \
9100
 
+            b'\xc5\x34\xa3\x52' b'\x66\x5c\x75\x45'
9101
 
 
9102
 
 
9103
 
     def testPackRequest0(self):
9104
 
-        bin = apply(request.CreateColormap._request.to_binary, (), self.req_args_0)
9105
 
+        bin = request.CreateColormap._request.to_binary(*(), **self.req_args_0)
9106
 
         try:
9107
 
             assert bin == self.req_bin_0
9108
 
         except AssertionError:
9109
 
@@ -3665,11 +3673,11 @@
9110
 
         self.req_args_0 = {
9111
 
             'cmap': 1948229362,
9112
 
             }
9113
 
-        self.req_bin_0 = '\x4f\x00\x02\x00' '\xf2\x9e\x1f\x74'
9114
 
+        self.req_bin_0 = b'\x4f\x00\x02\x00' b'\xf2\x9e\x1f\x74'
9115
 
 
9116
 
 
9117
 
     def testPackRequest0(self):
9118
 
-        bin = apply(request.FreeColormap._request.to_binary, (), self.req_args_0)
9119
 
+        bin = request.FreeColormap._request.to_binary(*(), **self.req_args_0)
9120
 
         try:
9121
 
             assert bin == self.req_bin_0
9122
 
         except AssertionError:
9123
 
@@ -3693,12 +3701,12 @@
9124
 
             'src_cmap': 836376231,
9125
 
             'mid': 1781544437,
9126
 
             }
9127
 
-        self.req_bin_0 = '\x50\x00\x03\x00' '\xf5\x35\x30\x6a' \
9128
 
-            '\xa7\x16\xda\x31'
9129
 
+        self.req_bin_0 = b'\x50\x00\x03\x00' b'\xf5\x35\x30\x6a' \
9130
 
+            b'\xa7\x16\xda\x31'
9131
 
 
9132
 
 
9133
 
     def testPackRequest0(self):
9134
 
-        bin = apply(request.CopyColormapAndFree._request.to_binary, (), self.req_args_0)
9135
 
+        bin = request.CopyColormapAndFree._request.to_binary(*(), **self.req_args_0)
9136
 
         try:
9137
 
             assert bin == self.req_bin_0
9138
 
         except AssertionError:
9139
 
@@ -3721,11 +3729,11 @@
9140
 
         self.req_args_0 = {
9141
 
             'cmap': 1065317214,
9142
 
             }
9143
 
-        self.req_bin_0 = '\x51\x00\x02\x00' '\x5e\x73\x7f\x3f'
9144
 
+        self.req_bin_0 = b'\x51\x00\x02\x00' b'\x5e\x73\x7f\x3f'
9145
 
 
9146
 
 
9147
 
     def testPackRequest0(self):
9148
 
-        bin = apply(request.InstallColormap._request.to_binary, (), self.req_args_0)
9149
 
+        bin = request.InstallColormap._request.to_binary(*(), **self.req_args_0)
9150
 
         try:
9151
 
             assert bin == self.req_bin_0
9152
 
         except AssertionError:
9153
 
@@ -3748,11 +3756,11 @@
9154
 
         self.req_args_0 = {
9155
 
             'cmap': 1636916558,
9156
 
             }
9157
 
-        self.req_bin_0 = '\x52\x00\x02\x00' '\x4e\x5d\x91\x61'
9158
 
+        self.req_bin_0 = b'\x52\x00\x02\x00' b'\x4e\x5d\x91\x61'
9159
 
 
9160
 
 
9161
 
     def testPackRequest0(self):
9162
 
-        bin = apply(request.UninstallColormap._request.to_binary, (), self.req_args_0)
9163
 
+        bin = request.UninstallColormap._request.to_binary(*(), **self.req_args_0)
9164
 
         try:
9165
 
             assert bin == self.req_bin_0
9166
 
         except AssertionError:
9167
 
@@ -3775,21 +3783,21 @@
9168
 
         self.req_args_0 = {
9169
 
             'window': 198767900,
9170
 
             }
9171
 
-        self.req_bin_0 = '\x53\x00\x02\x00' '\x1c\xf5\xd8\x0b'
9172
 
+        self.req_bin_0 = b'\x53\x00\x02\x00' b'\x1c\xf5\xd8\x0b'
9173
 
 
9174
 
         self.reply_args_0 = {
9175
 
             'cmaps': [6854304, 441133660],
9176
 
             'sequence_number': 56438,
9177
 
             }
9178
 
-        self.reply_bin_0 = '\x01\x00\x76\xdc' '\x02\x00\x00\x00' \
9179
 
-            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
9180
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9181
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9182
 
-            '\xa0\x96\x68\x00' '\x5c\x2a\x4b\x1a'
9183
 
+        self.reply_bin_0 = b'\x01\x00\x76\xdc' b'\x02\x00\x00\x00' \
9184
 
+            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
9185
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9186
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9187
 
+            b'\xa0\x96\x68\x00' b'\x5c\x2a\x4b\x1a'
9188
 
 
9189
 
 
9190
 
     def testPackRequest0(self):
9191
 
-        bin = apply(request.ListInstalledColormaps._request.to_binary, (), self.req_args_0)
9192
 
+        bin = request.ListInstalledColormaps._request.to_binary(*(), **self.req_args_0)
9193
 
         try:
9194
 
             assert bin == self.req_bin_0
9195
 
         except AssertionError:
9196
 
@@ -3807,7 +3815,7 @@
9197
 
             raise AssertionError(args)
9198
 
 
9199
 
     def testPackReply0(self):
9200
 
-        bin = apply(request.ListInstalledColormaps._reply.to_binary, (), self.reply_args_0)
9201
 
+        bin = request.ListInstalledColormaps._reply.to_binary(*(), **self.reply_args_0)
9202
 
         try:
9203
 
             assert bin == self.reply_bin_0
9204
 
         except AssertionError:
9205
 
@@ -3833,8 +3841,8 @@
9206
 
             'green': 61383,
9207
 
             'red': 8870,
9208
 
             }
9209
 
-        self.req_bin_0 = '\x54\x00\x04\x00' '\xdf\x36\xda\x69' \
9210
 
-            '\xa6\x22\xc7\xef' '\x24\xe2\x00\x00'
9211
 
+        self.req_bin_0 = b'\x54\x00\x04\x00' b'\xdf\x36\xda\x69' \
9212
 
+            b'\xa6\x22\xc7\xef' b'\x24\xe2\x00\x00'
9213
 
 
9214
 
         self.reply_args_0 = {
9215
 
             'blue': 22111,
9216
 
@@ -3843,14 +3851,14 @@
9217
 
             'sequence_number': 52666,
9218
 
             'pixel': 1186287049,
9219
 
             }
9220
 
-        self.reply_bin_0 = '\x01\x00\xba\xcd' '\x00\x00\x00\x00' \
9221
 
-            '\x61\xd4\x90\x6b' '\x5f\x56\x00\x00' \
9222
 
-            '\xc9\x4d\xb5\x46' '\x00\x00\x00\x00' \
9223
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
9224
 
+        self.reply_bin_0 = b'\x01\x00\xba\xcd' b'\x00\x00\x00\x00' \
9225
 
+            b'\x61\xd4\x90\x6b' b'\x5f\x56\x00\x00' \
9226
 
+            b'\xc9\x4d\xb5\x46' b'\x00\x00\x00\x00' \
9227
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
9228
 
 
9229
 
 
9230
 
     def testPackRequest0(self):
9231
 
-        bin = apply(request.AllocColor._request.to_binary, (), self.req_args_0)
9232
 
+        bin = request.AllocColor._request.to_binary(*(), **self.req_args_0)
9233
 
         try:
9234
 
             assert bin == self.req_bin_0
9235
 
         except AssertionError:
9236
 
@@ -3868,7 +3876,7 @@
9237
 
             raise AssertionError(args)
9238
 
 
9239
 
     def testPackReply0(self):
9240
 
-        bin = apply(request.AllocColor._reply.to_binary, (), self.reply_args_0)
9241
 
+        bin = request.AllocColor._reply.to_binary(*(), **self.reply_args_0)
9242
 
         try:
9243
 
             assert bin == self.reply_bin_0
9244
 
         except AssertionError:
9245
 
@@ -3892,9 +3900,9 @@
9246
 
             'cmap': 695059054,
9247
 
             'name': 'octarin',
9248
 
             }
9249
 
-        self.req_bin_0 = '\x55\x00\x05\x00' '\x6e\xc2\x6d\x29' \
9250
 
-            '\x07\x00\x00\x00' '\x6f\x63\x74\x61' \
9251
 
-            '\x72\x69\x6e\x00'
9252
 
+        self.req_bin_0 = b'\x55\x00\x05\x00' b'\x6e\xc2\x6d\x29' \
9253
 
+            b'\x07\x00\x00\x00' b'\x6f\x63\x74\x61' \
9254
 
+            b'\x72\x69\x6e\x00'
9255
 
 
9256
 
         self.reply_args_0 = {
9257
 
             'exact_red': 45174,
9258
 
@@ -3906,14 +3914,14 @@
9259
 
             'sequence_number': 38835,
9260
 
             'pixel': 580415589,
9261
 
             }
9262
 
-        self.reply_bin_0 = '\x01\x00\xb3\x97' '\x00\x00\x00\x00' \
9263
 
-            '\x65\x70\x98\x22' '\x76\xb0\xca\xaf' \
9264
 
-            '\xa3\xda\x51\xec' '\x6b\xbb\xd6\x54' \
9265
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
9266
 
+        self.reply_bin_0 = b'\x01\x00\xb3\x97' b'\x00\x00\x00\x00' \
9267
 
+            b'\x65\x70\x98\x22' b'\x76\xb0\xca\xaf' \
9268
 
+            b'\xa3\xda\x51\xec' b'\x6b\xbb\xd6\x54' \
9269
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
9270
 
 
9271
 
 
9272
 
     def testPackRequest0(self):
9273
 
-        bin = apply(request.AllocNamedColor._request.to_binary, (), self.req_args_0)
9274
 
+        bin = request.AllocNamedColor._request.to_binary(*(), **self.req_args_0)
9275
 
         try:
9276
 
             assert bin == self.req_bin_0
9277
 
         except AssertionError:
9278
 
@@ -3931,7 +3939,7 @@
9279
 
             raise AssertionError(args)
9280
 
 
9281
 
     def testPackReply0(self):
9282
 
-        bin = apply(request.AllocNamedColor._reply.to_binary, (), self.reply_args_0)
9283
 
+        bin = request.AllocNamedColor._reply.to_binary(*(), **self.reply_args_0)
9284
 
         try:
9285
 
             assert bin == self.reply_bin_0
9286
 
         except AssertionError:
9287
 
@@ -3957,42 +3965,42 @@
9288
 
             'colors': 16292,
9289
 
             'planes': 14978,
9290
 
             }
9291
 
-        self.req_bin_0 = '\x56\x01\x03\x00' '\xb5\xe9\x73\x7b' \
9292
 
-            '\xa4\x3f\x82\x3a'
9293
 
+        self.req_bin_0 = b'\x56\x01\x03\x00' b'\xb5\xe9\x73\x7b' \
9294
 
+            b'\xa4\x3f\x82\x3a'
9295
 
 
9296
 
         self.reply_args_0 = {
9297
 
             'pixels': [1664874569, 198876857, 135035151, 1499807858, 600240169, 1403510863, 757170725, 929995606, 155550883, 642439566, 971734621, 1359474267, 609593319, 669993327, 1837906914, 1355959290, 835285748],
9298
 
             'masks': [50898278, 362272940, 1106373487],
9299
 
             'sequence_number': 57786,
9300
 
             }
9301
 
-        self.reply_bin_0 = '\x01\x00\xba\xe1' '\x14\x00\x00\x00' \
9302
 
-            '\x11\x00\x03\x00' '\x00\x00\x00\x00' \
9303
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9304
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9305
 
-            '\x49\xf8\x3b\x63' '\xb9\x9e\xda\x0b' \
9306
 
-            '\x0f\x79\x0c\x08' '\x72\x40\x65\x59' \
9307
 
-            '\x29\xf0\xc6\x23' '\x4f\xe0\xa7\x53' \
9308
 
-            '\x25\x82\x21\x2d' '\x56\x9b\x6e\x37' \
9309
 
-            '\xa3\x84\x45\x09' '\x8e\xd9\x4a\x26' \
9310
 
-            '\x5d\x7e\xeb\x39' '\x5b\xee\x07\x51' \
9311
 
-            '\xe7\xa7\x55\x24' '\x6f\x49\xef\x27' \
9312
 
-            '\xe2\x3b\x8c\x6d' '\xfa\x4b\xd2\x50' \
9313
 
-            '\xf4\x72\xc9\x31' '\x66\xa5\x08\x03' \
9314
 
-            '\xac\xd8\x97\x15' '\x6f\xeb\xf1\x41'
9315
 
+        self.reply_bin_0 = b'\x01\x00\xba\xe1' b'\x14\x00\x00\x00' \
9316
 
+            b'\x11\x00\x03\x00' b'\x00\x00\x00\x00' \
9317
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9318
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9319
 
+            b'\x49\xf8\x3b\x63' b'\xb9\x9e\xda\x0b' \
9320
 
+            b'\x0f\x79\x0c\x08' b'\x72\x40\x65\x59' \
9321
 
+            b'\x29\xf0\xc6\x23' b'\x4f\xe0\xa7\x53' \
9322
 
+            b'\x25\x82\x21\x2d' b'\x56\x9b\x6e\x37' \
9323
 
+            b'\xa3\x84\x45\x09' b'\x8e\xd9\x4a\x26' \
9324
 
+            b'\x5d\x7e\xeb\x39' b'\x5b\xee\x07\x51' \
9325
 
+            b'\xe7\xa7\x55\x24' b'\x6f\x49\xef\x27' \
9326
 
+            b'\xe2\x3b\x8c\x6d' b'\xfa\x4b\xd2\x50' \
9327
 
+            b'\xf4\x72\xc9\x31' b'\x66\xa5\x08\x03' \
9328
 
+            b'\xac\xd8\x97\x15' b'\x6f\xeb\xf1\x41'
9329
 
 
9330
 
         self.reply_args_1 = {
9331
 
             'pixels': [],
9332
 
             'masks': [],
9333
 
             'sequence_number': 49324,
9334
 
             }
9335
 
-        self.reply_bin_1 = '\x01\x00\xac\xc0' '\x00\x00\x00\x00' \
9336
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9337
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9338
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
9339
 
+        self.reply_bin_1 = b'\x01\x00\xac\xc0' b'\x00\x00\x00\x00' \
9340
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9341
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9342
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
9343
 
 
9344
 
 
9345
 
     def testPackRequest0(self):
9346
 
-        bin = apply(request.AllocColorCells._request.to_binary, (), self.req_args_0)
9347
 
+        bin = request.AllocColorCells._request.to_binary(*(), **self.req_args_0)
9348
 
         try:
9349
 
             assert bin == self.req_bin_0
9350
 
         except AssertionError:
9351
 
@@ -4010,7 +4018,7 @@
9352
 
             raise AssertionError(args)
9353
 
 
9354
 
     def testPackReply0(self):
9355
 
-        bin = apply(request.AllocColorCells._reply.to_binary, (), self.reply_args_0)
9356
 
+        bin = request.AllocColorCells._reply.to_binary(*(), **self.reply_args_0)
9357
 
         try:
9358
 
             assert bin == self.reply_bin_0
9359
 
         except AssertionError:
9360
 
@@ -4028,7 +4036,7 @@
9361
 
             raise AssertionError(args)
9362
 
 
9363
 
     def testPackReply1(self):
9364
 
-        bin = apply(request.AllocColorCells._reply.to_binary, (), self.reply_args_1)
9365
 
+        bin = request.AllocColorCells._reply.to_binary(*(), **self.reply_args_1)
9366
 
         try:
9367
 
             assert bin == self.reply_bin_1
9368
 
         except AssertionError:
9369
 
@@ -4056,8 +4064,8 @@
9370
 
             'contiguous': 1,
9371
 
             'red': 37700,
9372
 
             }
9373
 
-        self.req_bin_0 = '\x57\x01\x04\x00' '\xd7\xef\xa3\x7d' \
9374
 
-            '\x7f\x2e\x44\x93' '\xfe\x83\xc1\x85'
9375
 
+        self.req_bin_0 = b'\x57\x01\x04\x00' b'\xd7\xef\xa3\x7d' \
9376
 
+            b'\x7f\x2e\x44\x93' b'\xfe\x83\xc1\x85'
9377
 
 
9378
 
         self.reply_args_0 = {
9379
 
             'red_mask': 931105404,
9380
 
@@ -4066,16 +4074,16 @@
9381
 
             'sequence_number': 17565,
9382
 
             'green_mask': 1072565720,
9383
 
             }
9384
 
-        self.reply_bin_0 = '\x01\x00\x9d\x44' '\x04\x00\x00\x00' \
9385
 
-            '\x04\x00\x00\x00' '\x7c\x8a\x7f\x37' \
9386
 
-            '\xd8\x0d\xee\x3f' '\x22\x6f\x22\x34' \
9387
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9388
 
-            '\xc1\x6a\xe4\x63' '\x4c\x82\xa2\x4a' \
9389
 
-            '\x37\x09\x41\x02' '\x4a\xdf\xc6\x57'
9390
 
+        self.reply_bin_0 = b'\x01\x00\x9d\x44' b'\x04\x00\x00\x00' \
9391
 
+            b'\x04\x00\x00\x00' b'\x7c\x8a\x7f\x37' \
9392
 
+            b'\xd8\x0d\xee\x3f' b'\x22\x6f\x22\x34' \
9393
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9394
 
+            b'\xc1\x6a\xe4\x63' b'\x4c\x82\xa2\x4a' \
9395
 
+            b'\x37\x09\x41\x02' b'\x4a\xdf\xc6\x57'
9396
 
 
9397
 
 
9398
 
     def testPackRequest0(self):
9399
 
-        bin = apply(request.AllocColorPlanes._request.to_binary, (), self.req_args_0)
9400
 
+        bin = request.AllocColorPlanes._request.to_binary(*(), **self.req_args_0)
9401
 
         try:
9402
 
             assert bin == self.req_bin_0
9403
 
         except AssertionError:
9404
 
@@ -4093,7 +4101,7 @@
9405
 
             raise AssertionError(args)
9406
 
 
9407
 
     def testPackReply0(self):
9408
 
-        bin = apply(request.AllocColorPlanes._reply.to_binary, (), self.reply_args_0)
9409
 
+        bin = request.AllocColorPlanes._reply.to_binary(*(), **self.reply_args_0)
9410
 
         try:
9411
 
             assert bin == self.reply_bin_0
9412
 
         except AssertionError:
9413
 
@@ -4118,20 +4126,20 @@
9414
 
             'plane_mask': 1074378407,
9415
 
             'pixels': [2014216051, 1664038241, 1220941033, 1378294408, 197757808, 793595544, 1289781247, 713684847, 1724469541, 1432124373, 1426727603, 1787792301, 406458839, 1918513211, 441394489, 988895943, 146997744],
9416
 
             }
9417
 
-        self.req_bin_0 = '\x58\x00\x14\x00' '\x1e\xdf\xf2\x01' \
9418
 
-            '\xa7\xb6\x09\x40' '\x73\x7f\x0e\x78' \
9419
 
-            '\x61\x35\x2f\x63' '\xe9\x14\xc6\x48' \
9420
 
-            '\x88\x1a\x27\x52' '\x70\x8b\xc9\x0b' \
9421
 
-            '\x98\x4e\x4d\x2f' '\xff\x7f\xe0\x4c' \
9422
 
-            '\x6f\xf7\x89\x2a' '\x25\x51\xc9\x66' \
9423
 
-            '\xd5\x7b\x5c\x55' '\xb3\x22\x0a\x55' \
9424
 
-            '\xad\x8b\x8f\x6a' '\xd7\x11\x3a\x18' \
9425
 
-            '\x3b\x30\x5a\x72' '\x39\x25\x4f\x1a' \
9426
 
-            '\xc7\x5a\xf1\x3a' '\xf0\x01\xc3\x08'
9427
 
+        self.req_bin_0 = b'\x58\x00\x14\x00' b'\x1e\xdf\xf2\x01' \
9428
 
+            b'\xa7\xb6\x09\x40' b'\x73\x7f\x0e\x78' \
9429
 
+            b'\x61\x35\x2f\x63' b'\xe9\x14\xc6\x48' \
9430
 
+            b'\x88\x1a\x27\x52' b'\x70\x8b\xc9\x0b' \
9431
 
+            b'\x98\x4e\x4d\x2f' b'\xff\x7f\xe0\x4c' \
9432
 
+            b'\x6f\xf7\x89\x2a' b'\x25\x51\xc9\x66' \
9433
 
+            b'\xd5\x7b\x5c\x55' b'\xb3\x22\x0a\x55' \
9434
 
+            b'\xad\x8b\x8f\x6a' b'\xd7\x11\x3a\x18' \
9435
 
+            b'\x3b\x30\x5a\x72' b'\x39\x25\x4f\x1a' \
9436
 
+            b'\xc7\x5a\xf1\x3a' b'\xf0\x01\xc3\x08'
9437
 
 
9438
 
 
9439
 
     def testPackRequest0(self):
9440
 
-        bin = apply(request.FreeColors._request.to_binary, (), self.req_args_0)
9441
 
+        bin = request.FreeColors._request.to_binary(*(), **self.req_args_0)
9442
 
         try:
9443
 
             assert bin == self.req_bin_0
9444
 
         except AssertionError:
9445
 
@@ -4155,17 +4163,17 @@
9446
 
             'items': [{'blue': 3577, 'flags': 221, 'green': 15650, 'pixel': 330879354, 'red': 30294}, {'blue': 18226, 'flags': 219, 'green': 45614, 'pixel': 302874221, 'red': 54265}, {'blue': 32215, 'flags': 160, 'green': 48737, 'pixel': 1699694808, 'red': 60115}, {'blue': 28524, 'flags': 209, 'green': 37615, 'pixel': 710550693, 'red': 50488}],
9447
 
             'cmap': 1791140577,
9448
 
             }
9449
 
-        self.req_bin_0 = '\x59\x00\x0e\x00' '\xe1\xa2\xc2\x6a' \
9450
 
-            '\x7a\xd1\xb8\x13' '\x56\x76\x22\x3d' \
9451
 
-            '\xf9\x0d\xdd\x00' '\x6d\x7e\x0d\x12' \
9452
 
-            '\xf9\xd3\x2e\xb2' '\x32\x47\xdb\x00' \
9453
 
-            '\xd8\x48\x4f\x65' '\xd3\xea\x61\xbe' \
9454
 
-            '\xd7\x7d\xa0\x00' '\xa5\x24\x5a\x2a' \
9455
 
-            '\x38\xc5\xef\x92' '\x6c\x6f\xd1\x00'
9456
 
+        self.req_bin_0 = b'\x59\x00\x0e\x00' b'\xe1\xa2\xc2\x6a' \
9457
 
+            b'\x7a\xd1\xb8\x13' b'\x56\x76\x22\x3d' \
9458
 
+            b'\xf9\x0d\xdd\x00' b'\x6d\x7e\x0d\x12' \
9459
 
+            b'\xf9\xd3\x2e\xb2' b'\x32\x47\xdb\x00' \
9460
 
+            b'\xd8\x48\x4f\x65' b'\xd3\xea\x61\xbe' \
9461
 
+            b'\xd7\x7d\xa0\x00' b'\xa5\x24\x5a\x2a' \
9462
 
+            b'\x38\xc5\xef\x92' b'\x6c\x6f\xd1\x00'
9463
 
 
9464
 
 
9465
 
     def testPackRequest0(self):
9466
 
-        bin = apply(request.StoreColors._request.to_binary, (), self.req_args_0)
9467
 
+        bin = request.StoreColors._request.to_binary(*(), **self.req_args_0)
9468
 
         try:
9469
 
             assert bin == self.req_bin_0
9470
 
         except AssertionError:
9471
 
@@ -4191,13 +4199,13 @@
9472
 
             'name': 'blue',
9473
 
             'pixel': 413175613,
9474
 
             }
9475
 
-        self.req_bin_0 = '\x5a\xa9\x05\x00' '\xf4\xd5\xd0\x33' \
9476
 
-            '\x3d\x8f\xa0\x18' '\x04\x00\x00\x00' \
9477
 
-            '\x62\x6c\x75\x65'
9478
 
+        self.req_bin_0 = b'\x5a\xa9\x05\x00' b'\xf4\xd5\xd0\x33' \
9479
 
+            b'\x3d\x8f\xa0\x18' b'\x04\x00\x00\x00' \
9480
 
+            b'\x62\x6c\x75\x65'
9481
 
 
9482
 
 
9483
 
     def testPackRequest0(self):
9484
 
-        bin = apply(request.StoreNamedColor._request.to_binary, (), self.req_args_0)
9485
 
+        bin = request.StoreNamedColor._request.to_binary(*(), **self.req_args_0)
9486
 
         try:
9487
 
             assert bin == self.req_bin_0
9488
 
         except AssertionError:
9489
 
@@ -4221,35 +4229,35 @@
9490
 
             'cmap': 1750052450,
9491
 
             'pixels': [1673396539, 1897675292, 1453845591, 816818886, 897340342, 1782049962, 796231465, 722380604],
9492
 
             }
9493
 
-        self.req_bin_0 = '\x5b\x00\x0a\x00' '\x62\xae\x4f\x68' \
9494
 
-            '\x3b\x01\xbe\x63' '\x1c\x3a\x1c\x71' \
9495
 
-            '\x57\xec\xa7\x56' '\xc6\xaa\xaf\x30' \
9496
 
-            '\xb6\x53\x7c\x35' '\xaa\xec\x37\x6a' \
9497
 
-            '\x29\x87\x75\x2f' '\x3c\xa7\x0e\x2b'
9498
 
+        self.req_bin_0 = b'\x5b\x00\x0a\x00' b'\x62\xae\x4f\x68' \
9499
 
+            b'\x3b\x01\xbe\x63' b'\x1c\x3a\x1c\x71' \
9500
 
+            b'\x57\xec\xa7\x56' b'\xc6\xaa\xaf\x30' \
9501
 
+            b'\xb6\x53\x7c\x35' b'\xaa\xec\x37\x6a' \
9502
 
+            b'\x29\x87\x75\x2f' b'\x3c\xa7\x0e\x2b'
9503
 
 
9504
 
         self.reply_args_0 = {
9505
 
             'colors': [{'blue': 63820, 'green': 60107, 'red': 62261}, {'blue': 54480, 'green': 48839, 'red': 10033}, {'blue': 31765, 'green': 31737, 'red': 43117}, {'blue': 50953, 'green': 52009, 'red': 14234}, {'blue': 55150, 'green': 30330, 'red': 55956}],
9506
 
             'sequence_number': 10895,
9507
 
             }
9508
 
-        self.reply_bin_0 = '\x01\x00\x8f\x2a' '\x0a\x00\x00\x00' \
9509
 
-            '\x05\x00\x00\x00' '\x00\x00\x00\x00' \
9510
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9511
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9512
 
-            '\x35\xf3\xcb\xea' '\x4c\xf9\x00\x00' \
9513
 
-            '\x31\x27\xc7\xbe' '\xd0\xd4\x00\x00' \
9514
 
-            '\x6d\xa8\xf9\x7b' '\x15\x7c\x00\x00' \
9515
 
-            '\x9a\x37\x29\xcb' '\x09\xc7\x00\x00' \
9516
 
-            '\x94\xda\x7a\x76' '\x6e\xd7\x00\x00'
9517
 
+        self.reply_bin_0 = b'\x01\x00\x8f\x2a' b'\x0a\x00\x00\x00' \
9518
 
+            b'\x05\x00\x00\x00' b'\x00\x00\x00\x00' \
9519
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9520
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9521
 
+            b'\x35\xf3\xcb\xea' b'\x4c\xf9\x00\x00' \
9522
 
+            b'\x31\x27\xc7\xbe' b'\xd0\xd4\x00\x00' \
9523
 
+            b'\x6d\xa8\xf9\x7b' b'\x15\x7c\x00\x00' \
9524
 
+            b'\x9a\x37\x29\xcb' b'\x09\xc7\x00\x00' \
9525
 
+            b'\x94\xda\x7a\x76' b'\x6e\xd7\x00\x00'
9526
 
 
9527
 
         self.req_args_1 = {
9528
 
             'cmap': 340337174,
9529
 
             'pixels': [],
9530
 
             }
9531
 
-        self.req_bin_1 = '\x5b\x00\x02\x00' '\x16\x22\x49\x14'
9532
 
+        self.req_bin_1 = b'\x5b\x00\x02\x00' b'\x16\x22\x49\x14'
9533
 
 
9534
 
 
9535
 
     def testPackRequest0(self):
9536
 
-        bin = apply(request.QueryColors._request.to_binary, (), self.req_args_0)
9537
 
+        bin = request.QueryColors._request.to_binary(*(), **self.req_args_0)
9538
 
         try:
9539
 
             assert bin == self.req_bin_0
9540
 
         except AssertionError:
9541
 
@@ -4267,7 +4275,7 @@
9542
 
             raise AssertionError(args)
9543
 
 
9544
 
     def testPackRequest1(self):
9545
 
-        bin = apply(request.QueryColors._request.to_binary, (), self.req_args_1)
9546
 
+        bin = request.QueryColors._request.to_binary(*(), **self.req_args_1)
9547
 
         try:
9548
 
             assert bin == self.req_bin_1
9549
 
         except AssertionError:
9550
 
@@ -4285,7 +4293,7 @@
9551
 
             raise AssertionError(args)
9552
 
 
9553
 
     def testPackReply0(self):
9554
 
-        bin = apply(request.QueryColors._reply.to_binary, (), self.reply_args_0)
9555
 
+        bin = request.QueryColors._reply.to_binary(*(), **self.reply_args_0)
9556
 
         try:
9557
 
             assert bin == self.reply_bin_0
9558
 
         except AssertionError:
9559
 
@@ -4309,9 +4317,9 @@
9560
 
             'cmap': 2120409969,
9561
 
             'name': 'octarin',
9562
 
             }
9563
 
-        self.req_bin_0 = '\x5c\x00\x05\x00' '\x71\xe3\x62\x7e' \
9564
 
-            '\x07\x00\x00\x00' '\x6f\x63\x74\x61' \
9565
 
-            '\x72\x69\x6e\x00'
9566
 
+        self.req_bin_0 = b'\x5c\x00\x05\x00' b'\x71\xe3\x62\x7e' \
9567
 
+            b'\x07\x00\x00\x00' b'\x6f\x63\x74\x61' \
9568
 
+            b'\x72\x69\x6e\x00'
9569
 
 
9570
 
         self.reply_args_0 = {
9571
 
             'exact_red': 63730,
9572
 
@@ -4322,14 +4330,14 @@
9573
 
             'screen_red': 26587,
9574
 
             'sequence_number': 2933,
9575
 
             }
9576
 
-        self.reply_bin_0 = '\x01\x00\x75\x0b' '\x00\x00\x00\x00' \
9577
 
-            '\xf2\xf8\x50\x5f' '\x65\x6b\xdb\x67' \
9578
 
-            '\x06\x3e\xfb\x24' '\x00\x00\x00\x00' \
9579
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
9580
 
+        self.reply_bin_0 = b'\x01\x00\x75\x0b' b'\x00\x00\x00\x00' \
9581
 
+            b'\xf2\xf8\x50\x5f' b'\x65\x6b\xdb\x67' \
9582
 
+            b'\x06\x3e\xfb\x24' b'\x00\x00\x00\x00' \
9583
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
9584
 
 
9585
 
 
9586
 
     def testPackRequest0(self):
9587
 
-        bin = apply(request.LookupColor._request.to_binary, (), self.req_args_0)
9588
 
+        bin = request.LookupColor._request.to_binary(*(), **self.req_args_0)
9589
 
         try:
9590
 
             assert bin == self.req_bin_0
9591
 
         except AssertionError:
9592
 
@@ -4347,7 +4355,7 @@
9593
 
             raise AssertionError(args)
9594
 
 
9595
 
     def testPackReply0(self):
9596
 
-        bin = apply(request.LookupColor._reply.to_binary, (), self.reply_args_0)
9597
 
+        bin = request.LookupColor._reply.to_binary(*(), **self.reply_args_0)
9598
 
         try:
9599
 
             assert bin == self.reply_bin_0
9600
 
         except AssertionError:
9601
 
@@ -4380,14 +4388,14 @@
9602
 
             'x': 731,
9603
 
             'back_red': 30886,
9604
 
             }
9605
 
-        self.req_bin_0 = '\x5d\x00\x08\x00' '\xa6\x29\xd3\x52' \
9606
 
-            '\x5d\x7b\xd1\x7a' '\xf2\xa8\xf2\x57' \
9607
 
-            '\x9f\xa7\x3b\x7d' '\xdd\xb1\xa6\x78' \
9608
 
-            '\x15\x24\x39\x1d' '\xdb\x02\xa7\x7c'
9609
 
+        self.req_bin_0 = b'\x5d\x00\x08\x00' b'\xa6\x29\xd3\x52' \
9610
 
+            b'\x5d\x7b\xd1\x7a' b'\xf2\xa8\xf2\x57' \
9611
 
+            b'\x9f\xa7\x3b\x7d' b'\xdd\xb1\xa6\x78' \
9612
 
+            b'\x15\x24\x39\x1d' b'\xdb\x02\xa7\x7c'
9613
 
 
9614
 
 
9615
 
     def testPackRequest0(self):
9616
 
-        bin = apply(request.CreateCursor._request.to_binary, (), self.req_args_0)
9617
 
+        bin = request.CreateCursor._request.to_binary(*(), **self.req_args_0)
9618
 
         try:
9619
 
             assert bin == self.req_bin_0
9620
 
         except AssertionError:
9621
 
@@ -4420,14 +4428,14 @@
9622
 
             'source_char': 50271,
9623
 
             'back_red': 13590,
9624
 
             }
9625
 
-        self.req_bin_0 = '\x5e\x00\x08\x00' '\x31\xe7\xc1\x6d' \
9626
 
-            '\x2a\x85\x48\x01' '\x50\x9a\x89\x10' \
9627
 
-            '\x5f\xc4\xdc\x4a' '\xeb\x23\xfc\xc7' \
9628
 
-            '\xb7\x62\x16\x35' '\xed\xd7\xfb\x1c'
9629
 
+        self.req_bin_0 = b'\x5e\x00\x08\x00' b'\x31\xe7\xc1\x6d' \
9630
 
+            b'\x2a\x85\x48\x01' b'\x50\x9a\x89\x10' \
9631
 
+            b'\x5f\xc4\xdc\x4a' b'\xeb\x23\xfc\xc7' \
9632
 
+            b'\xb7\x62\x16\x35' b'\xed\xd7\xfb\x1c'
9633
 
 
9634
 
 
9635
 
     def testPackRequest0(self):
9636
 
-        bin = apply(request.CreateGlyphCursor._request.to_binary, (), self.req_args_0)
9637
 
+        bin = request.CreateGlyphCursor._request.to_binary(*(), **self.req_args_0)
9638
 
         try:
9639
 
             assert bin == self.req_bin_0
9640
 
         except AssertionError:
9641
 
@@ -4450,11 +4458,11 @@
9642
 
         self.req_args_0 = {
9643
 
             'cursor': 830435200,
9644
 
             }
9645
 
-        self.req_bin_0 = '\x5f\x00\x02\x00' '\x80\x6f\x7f\x31'
9646
 
+        self.req_bin_0 = b'\x5f\x00\x02\x00' b'\x80\x6f\x7f\x31'
9647
 
 
9648
 
 
9649
 
     def testPackRequest0(self):
9650
 
-        bin = apply(request.FreeCursor._request.to_binary, (), self.req_args_0)
9651
 
+        bin = request.FreeCursor._request.to_binary(*(), **self.req_args_0)
9652
 
         try:
9653
 
             assert bin == self.req_bin_0
9654
 
         except AssertionError:
9655
 
@@ -4483,13 +4491,13 @@
9656
 
             'fore_green': 39148,
9657
 
             'fore_red': 48154,
9658
 
             }
9659
 
-        self.req_bin_0 = '\x60\x00\x05\x00' '\xc3\xa3\xe5\x23' \
9660
 
-            '\x1a\xbc\xec\x98' '\x24\xfa\x82\x17' \
9661
 
-            '\x80\xbf\x4f\x3c'
9662
 
+        self.req_bin_0 = b'\x60\x00\x05\x00' b'\xc3\xa3\xe5\x23' \
9663
 
+            b'\x1a\xbc\xec\x98' b'\x24\xfa\x82\x17' \
9664
 
+            b'\x80\xbf\x4f\x3c'
9665
 
 
9666
 
 
9667
 
     def testPackRequest0(self):
9668
 
-        bin = apply(request.RecolorCursor._request.to_binary, (), self.req_args_0)
9669
 
+        bin = request.RecolorCursor._request.to_binary(*(), **self.req_args_0)
9670
 
         try:
9671
 
             assert bin == self.req_bin_0
9672
 
         except AssertionError:
9673
 
@@ -4515,22 +4523,22 @@
9674
 
             'drawable': 1606665099,
9675
 
             'height': 4701,
9676
 
             }
9677
 
-        self.req_bin_0 = '\x61\x01\x03\x00' '\x8b\xc3\xc3\x5f' \
9678
 
-            '\x60\xce\x5d\x12'
9679
 
+        self.req_bin_0 = b'\x61\x01\x03\x00' b'\x8b\xc3\xc3\x5f' \
9680
 
+            b'\x60\xce\x5d\x12'
9681
 
 
9682
 
         self.reply_args_0 = {
9683
 
             'width': 33709,
9684
 
             'sequence_number': 43788,
9685
 
             'height': 12826,
9686
 
             }
9687
 
-        self.reply_bin_0 = '\x01\x00\x0c\xab' '\x00\x00\x00\x00' \
9688
 
-            '\xad\x83\x1a\x32' '\x00\x00\x00\x00' \
9689
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9690
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
9691
 
+        self.reply_bin_0 = b'\x01\x00\x0c\xab' b'\x00\x00\x00\x00' \
9692
 
+            b'\xad\x83\x1a\x32' b'\x00\x00\x00\x00' \
9693
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9694
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
9695
 
 
9696
 
 
9697
 
     def testPackRequest0(self):
9698
 
-        bin = apply(request.QueryBestSize._request.to_binary, (), self.req_args_0)
9699
 
+        bin = request.QueryBestSize._request.to_binary(*(), **self.req_args_0)
9700
 
         try:
9701
 
             assert bin == self.req_bin_0
9702
 
         except AssertionError:
9703
 
@@ -4548,7 +4556,7 @@
9704
 
             raise AssertionError(args)
9705
 
 
9706
 
     def testPackReply0(self):
9707
 
-        bin = apply(request.QueryBestSize._reply.to_binary, (), self.reply_args_0)
9708
 
+        bin = request.QueryBestSize._reply.to_binary(*(), **self.reply_args_0)
9709
 
         try:
9710
 
             assert bin == self.reply_bin_0
9711
 
         except AssertionError:
9712
 
@@ -4571,8 +4579,8 @@
9713
 
         self.req_args_0 = {
9714
 
             'name': 'XTRA',
9715
 
             }
9716
 
-        self.req_bin_0 = '\x62\x00\x03\x00' '\x04\x00\x00\x00' \
9717
 
-            '\x58\x54\x52\x41'
9718
 
+        self.req_bin_0 = b'\x62\x00\x03\x00' b'\x04\x00\x00\x00' \
9719
 
+            b'\x58\x54\x52\x41'
9720
 
 
9721
 
         self.reply_args_0 = {
9722
 
             'first_event': 163,
9723
 
@@ -4581,14 +4589,14 @@
9724
 
             'present': 1,
9725
 
             'sequence_number': 3124,
9726
 
             }
9727
 
-        self.reply_bin_0 = '\x01\x00\x34\x0c' '\x00\x00\x00\x00' \
9728
 
-            '\x01\xd7\xa3\xa6' '\x00\x00\x00\x00' \
9729
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9730
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
9731
 
+        self.reply_bin_0 = b'\x01\x00\x34\x0c' b'\x00\x00\x00\x00' \
9732
 
+            b'\x01\xd7\xa3\xa6' b'\x00\x00\x00\x00' \
9733
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9734
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
9735
 
 
9736
 
 
9737
 
     def testPackRequest0(self):
9738
 
-        bin = apply(request.QueryExtension._request.to_binary, (), self.req_args_0)
9739
 
+        bin = request.QueryExtension._request.to_binary(*(), **self.req_args_0)
9740
 
         try:
9741
 
             assert bin == self.req_bin_0
9742
 
         except AssertionError:
9743
 
@@ -4606,7 +4614,7 @@
9744
 
             raise AssertionError(args)
9745
 
 
9746
 
     def testPackReply0(self):
9747
 
-        bin = apply(request.QueryExtension._reply.to_binary, (), self.reply_args_0)
9748
 
+        bin = request.QueryExtension._reply.to_binary(*(), **self.reply_args_0)
9749
 
         try:
9750
 
             assert bin == self.reply_bin_0
9751
 
         except AssertionError:
9752
 
@@ -4628,22 +4636,22 @@
9753
 
     def setUp(self):
9754
 
         self.req_args_0 = {
9755
 
             }
9756
 
-        self.req_bin_0 = '\x63\x00\x01\x00'
9757
 
+        self.req_bin_0 = b'\x63\x00\x01\x00'
9758
 
 
9759
 
         self.reply_args_0 = {
9760
 
             'names': ['XTRA', 'XTRA-II'],
9761
 
             'sequence_number': 21122,
9762
 
             }
9763
 
-        self.reply_bin_0 = '\x01\x02\x82\x52' '\x04\x00\x00\x00' \
9764
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9765
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9766
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9767
 
-            '\x04\x58\x54\x52' '\x41\x07\x58\x54' \
9768
 
-            '\x52\x41\x2d\x49' '\x49\x00\x00\x00'
9769
 
+        self.reply_bin_0 = b'\x01\x02\x82\x52' b'\x04\x00\x00\x00' \
9770
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9771
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9772
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9773
 
+            b'\x04\x58\x54\x52' b'\x41\x07\x58\x54' \
9774
 
+            b'\x52\x41\x2d\x49' b'\x49\x00\x00\x00'
9775
 
 
9776
 
 
9777
 
     def testPackRequest0(self):
9778
 
-        bin = apply(request.ListExtensions._request.to_binary, (), self.req_args_0)
9779
 
+        bin = request.ListExtensions._request.to_binary(*(), **self.req_args_0)
9780
 
         try:
9781
 
             assert bin == self.req_bin_0
9782
 
         except AssertionError:
9783
 
@@ -4661,7 +4669,7 @@
9784
 
             raise AssertionError(args)
9785
 
 
9786
 
     def testPackReply0(self):
9787
 
-        bin = apply(request.ListExtensions._reply.to_binary, (), self.reply_args_0)
9788
 
+        bin = request.ListExtensions._reply.to_binary(*(), **self.reply_args_0)
9789
 
         try:
9790
 
             assert bin == self.reply_bin_0
9791
 
         except AssertionError:
9792
 
@@ -4685,41 +4693,41 @@
9793
 
             'first_keycode': 131,
9794
 
             'keysyms': [[1479273593, 495399194, 1752874714], [183124138, 826800766, 542058728], [519501686, 1358630902, 1051542205], [1363902850, 52079613, 1721268402], [2124568309, 323328202, 1426344655], [1775218167, 1821828429, 1704892958], [1784543283, 783698836, 1882907069], [1165130550, 1276086917, 957090966], [1623553701, 77158667, 420399405], [790514637, 1104383431, 1645303152], [879499287, 349457843, 1313813953], [367336866, 1207824094, 514125338], [767413913, 135340640, 756292967], [475442692, 2076098223, 1252936842], [964050497, 2006979633, 948353974], [1923834215, 1061136894, 1319606154], [1186538913, 1770176901, 715354628], [1470481551, 403222608, 252019996], [260033548, 1553379907, 1096456683], [2027881549, 1992616114, 382810564]],
9795
 
             }
9796
 
-        self.req_bin_0 = '\x64\x14\x3e\x00' '\x83\x03\x00\x00' \
9797
 
-            '\x79\xec\x2b\x58' '\x1a\x31\x87\x1d' \
9798
 
-            '\xda\xbe\x7a\x68' '\xaa\x40\xea\x0a' \
9799
 
-            '\x7e\xfa\x47\x31' '\xe8\x28\x4f\x20' \
9800
 
-            '\x76\xf7\xf6\x1e' '\xf6\x0f\xfb\x50' \
9801
 
-            '\xbd\x42\xad\x3e' '\x82\x81\x4b\x51' \
9802
 
-            '\xfd\xab\x1a\x03' '\xb2\x78\x98\x66' \
9803
 
-            '\xf5\x56\xa2\x7e' '\xca\x98\x45\x13' \
9804
 
-            '\xcf\x4a\x04\x55' '\xf7\xad\xcf\x69' \
9805
 
-            '\x4d\xe5\x96\x6c' '\x1e\x9a\x9e\x65' \
9806
 
-            '\x33\xf8\x5d\x6a' '\x94\x4b\xb6\x2e' \
9807
 
-            '\xbd\xe1\x3a\x70' '\x36\x7b\x72\x45' \
9808
 
-            '\x85\x8a\x0f\x4c' '\x96\x0c\x0c\x39' \
9809
 
-            '\xa5\x76\xc5\x60' '\x0b\x59\x99\x04' \
9810
 
-            '\x2d\xc9\x0e\x19' '\xcd\x4b\x1e\x2f' \
9811
 
-            '\xc7\x8d\xd3\x41' '\x70\x55\x11\x62' \
9812
 
-            '\x17\x18\x6c\x34' '\xb3\x4d\xd4\x14' \
9813
 
-            '\xc1\x35\x4f\x4e' '\xa2\x1d\xe5\x15' \
9814
 
-            '\xde\xee\xfd\x47' '\x1a\xee\xa4\x1e' \
9815
 
-            '\x99\xce\xbd\x2d' '\x60\x22\x11\x08' \
9816
 
-            '\x67\x1d\x14\x2d' '\x04\xae\x56\x1c' \
9817
 
-            '\xaf\xbe\xbe\x7b' '\x8a\x4c\xae\x4a' \
9818
 
-            '\x41\x3e\x76\x39' '\x31\x14\xa0\x77' \
9819
 
-            '\xb6\xbb\x86\x38' '\x67\x61\xab\x72' \
9820
 
-            '\xfe\xa9\x3f\x3f' '\x8a\x97\xa7\x4e' \
9821
 
-            '\xa1\x25\xb9\x46' '\x85\xc1\x82\x69' \
9822
 
-            '\x04\x72\xa3\x2a' '\x8f\xc4\xa5\x57' \
9823
 
-            '\x50\xb0\x08\x18' '\x1c\x85\x05\x0f' \
9824
 
-            '\x0c\xcc\x7f\x0f' '\x43\xb2\x96\x5c' \
9825
 
-            '\xeb\x99\x5a\x41' '\x4d\x04\xdf\x78' \
9826
 
-            '\xb2\xe8\xc4\x76' '\xc4\x39\xd1\x16'
9827
 
+        self.req_bin_0 = b'\x64\x14\x3e\x00' b'\x83\x03\x00\x00' \
9828
 
+            b'\x79\xec\x2b\x58' b'\x1a\x31\x87\x1d' \
9829
 
+            b'\xda\xbe\x7a\x68' b'\xaa\x40\xea\x0a' \
9830
 
+            b'\x7e\xfa\x47\x31' b'\xe8\x28\x4f\x20' \
9831
 
+            b'\x76\xf7\xf6\x1e' b'\xf6\x0f\xfb\x50' \
9832
 
+            b'\xbd\x42\xad\x3e' b'\x82\x81\x4b\x51' \
9833
 
+            b'\xfd\xab\x1a\x03' b'\xb2\x78\x98\x66' \
9834
 
+            b'\xf5\x56\xa2\x7e' b'\xca\x98\x45\x13' \
9835
 
+            b'\xcf\x4a\x04\x55' b'\xf7\xad\xcf\x69' \
9836
 
+            b'\x4d\xe5\x96\x6c' b'\x1e\x9a\x9e\x65' \
9837
 
+            b'\x33\xf8\x5d\x6a' b'\x94\x4b\xb6\x2e' \
9838
 
+            b'\xbd\xe1\x3a\x70' b'\x36\x7b\x72\x45' \
9839
 
+            b'\x85\x8a\x0f\x4c' b'\x96\x0c\x0c\x39' \
9840
 
+            b'\xa5\x76\xc5\x60' b'\x0b\x59\x99\x04' \
9841
 
+            b'\x2d\xc9\x0e\x19' b'\xcd\x4b\x1e\x2f' \
9842
 
+            b'\xc7\x8d\xd3\x41' b'\x70\x55\x11\x62' \
9843
 
+            b'\x17\x18\x6c\x34' b'\xb3\x4d\xd4\x14' \
9844
 
+            b'\xc1\x35\x4f\x4e' b'\xa2\x1d\xe5\x15' \
9845
 
+            b'\xde\xee\xfd\x47' b'\x1a\xee\xa4\x1e' \
9846
 
+            b'\x99\xce\xbd\x2d' b'\x60\x22\x11\x08' \
9847
 
+            b'\x67\x1d\x14\x2d' b'\x04\xae\x56\x1c' \
9848
 
+            b'\xaf\xbe\xbe\x7b' b'\x8a\x4c\xae\x4a' \
9849
 
+            b'\x41\x3e\x76\x39' b'\x31\x14\xa0\x77' \
9850
 
+            b'\xb6\xbb\x86\x38' b'\x67\x61\xab\x72' \
9851
 
+            b'\xfe\xa9\x3f\x3f' b'\x8a\x97\xa7\x4e' \
9852
 
+            b'\xa1\x25\xb9\x46' b'\x85\xc1\x82\x69' \
9853
 
+            b'\x04\x72\xa3\x2a' b'\x8f\xc4\xa5\x57' \
9854
 
+            b'\x50\xb0\x08\x18' b'\x1c\x85\x05\x0f' \
9855
 
+            b'\x0c\xcc\x7f\x0f' b'\x43\xb2\x96\x5c' \
9856
 
+            b'\xeb\x99\x5a\x41' b'\x4d\x04\xdf\x78' \
9857
 
+            b'\xb2\xe8\xc4\x76' b'\xc4\x39\xd1\x16'
9858
 
 
9859
 
 
9860
 
     def testPackRequest0(self):
9861
 
-        bin = apply(request.ChangeKeyboardMapping._request.to_binary, (), self.req_args_0)
9862
 
+        bin = request.ChangeKeyboardMapping._request.to_binary(*(), **self.req_args_0)
9863
 
         try:
9864
 
             assert bin == self.req_bin_0
9865
 
         except AssertionError:
9866
 
@@ -4743,50 +4751,50 @@
9867
 
             'first_keycode': 174,
9868
 
             'count': 233,
9869
 
             }
9870
 
-        self.req_bin_0 = '\x65\x00\x02\x00' '\xae\xe9\x00\x00'
9871
 
+        self.req_bin_0 = b'\x65\x00\x02\x00' b'\xae\xe9\x00\x00'
9872
 
 
9873
 
         self.reply_args_0 = {
9874
 
             'keysyms': [[536700486, 90972970, 1834434734], [604690854, 1612992766, 1785113276], [1258017014, 814047417, 79874791], [1752913778, 2069894554, 1342993084], [691283205, 2002270597, 1552550365], [1427239047, 80222814, 380890249], [932130695, 1233544402, 1343201446], [850296480, 830996690, 1219102856], [1427529259, 1334110395, 1423305447], [925543758, 1154246092, 389857513], [782217983, 1673349321, 296773941], [904384636, 788791004, 1427343811], [578056967, 1628142600, 882651915], [1727003528, 1202959768, 59536638], [932784259, 453243643, 1846802632], [1527858524, 2055184942, 1534128611], [134086768, 909769847, 323736641], [2080620639, 1573387975, 566724688], [1393924270, 1408645244, 1610610798], [391612329, 341605408, 484634403]],
9875
 
             'sequence_number': 27901,
9876
 
             }
9877
 
-        self.reply_bin_0 = '\x01\x03\xfd\x6c' '\x3c\x00\x00\x00' \
9878
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9879
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9880
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
9881
 
-            '\x46\x66\xfd\x1f' '\x2a\x23\x6c\x05' \
9882
 
-            '\xae\x40\x57\x6d' '\xa6\xd9\x0a\x24' \
9883
 
-            '\xfe\x50\x24\x60' '\xbc\xaa\x66\x6a' \
9884
 
-            '\xf6\xd0\xfb\x4a' '\xb9\x60\x85\x30' \
9885
 
-            '\xe7\xca\xc2\x04' '\x72\x57\x7b\x68' \
9886
 
-            '\x9a\x15\x60\x7b' '\xbc\x72\x0c\x50' \
9887
 
-            '\x05\x25\x34\x29' '\x85\x39\x58\x77' \
9888
 
-            '\xdd\x09\x8a\x5c' '\x87\xf0\x11\x55' \
9889
 
-            '\x5e\x1a\xc8\x04' '\x89\xec\xb3\x16' \
9890
 
-            '\x87\x2f\x8f\x37' '\xd2\x64\x86\x49' \
9891
 
-            '\xa6\xa0\x0f\x50' '\xa0\x7e\xae\x32' \
9892
 
-            '\xd2\x00\x88\x31' '\x88\x08\xaa\x48' \
9893
 
-            '\x2b\x5e\x16\x55' '\xbb\xe8\x84\x4f' \
9894
 
-            '\xe7\xea\xd5\x54' '\x4e\xad\x2a\x37' \
9895
 
-            '\xcc\x65\xcc\x44' '\xe9\xc0\x3c\x17' \
9896
 
-            '\xff\xb2\x9f\x2e' '\xc9\x48\xbd\x63' \
9897
 
-            '\x35\x69\xb0\x11' '\x7c\xd0\xe7\x35' \
9898
 
-            '\xdc\xfe\x03\x2f' '\xc3\x89\x13\x55' \
9899
 
-            '\x07\x73\x74\x22' '\x08\x7c\x0b\x61' \
9900
 
-            '\x0b\x33\x9c\x34' '\x88\xfb\xef\x66' \
9901
 
-            '\x98\xb5\xb3\x47' '\xfe\x74\x8c\x03' \
9902
 
-            '\x83\x28\x99\x37' '\xfb\xf2\x03\x1b' \
9903
 
-            '\xc8\xf8\x13\x6e' '\x5c\x45\x11\x5b' \
9904
 
-            '\x2e\xa2\x7f\x7a' '\xe3\xf1\x70\x5b' \
9905
 
-            '\x70\x00\xfe\x07' '\x77\xfc\x39\x36' \
9906
 
-            '\x41\xd4\x4b\x13' '\x5f\xc0\x03\x7c' \
9907
 
-            '\xc7\xfe\xc7\x5d' '\x50\x88\xc7\x21' \
9908
 
-            '\xae\x98\x15\x53' '\x7c\x38\xf6\x53' \
9909
 
-            '\x6e\xf8\xff\x5f' '\xa9\x87\x57\x17' \
9910
 
-            '\x20\x7c\x5c\x14' '\x23\xef\xe2\x1c'
9911
 
+        self.reply_bin_0 = b'\x01\x03\xfd\x6c' b'\x3c\x00\x00\x00' \
9912
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9913
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9914
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
9915
 
+            b'\x46\x66\xfd\x1f' b'\x2a\x23\x6c\x05' \
9916
 
+            b'\xae\x40\x57\x6d' b'\xa6\xd9\x0a\x24' \
9917
 
+            b'\xfe\x50\x24\x60' b'\xbc\xaa\x66\x6a' \
9918
 
+            b'\xf6\xd0\xfb\x4a' b'\xb9\x60\x85\x30' \
9919
 
+            b'\xe7\xca\xc2\x04' b'\x72\x57\x7b\x68' \
9920
 
+            b'\x9a\x15\x60\x7b' b'\xbc\x72\x0c\x50' \
9921
 
+            b'\x05\x25\x34\x29' b'\x85\x39\x58\x77' \
9922
 
+            b'\xdd\x09\x8a\x5c' b'\x87\xf0\x11\x55' \
9923
 
+            b'\x5e\x1a\xc8\x04' b'\x89\xec\xb3\x16' \
9924
 
+            b'\x87\x2f\x8f\x37' b'\xd2\x64\x86\x49' \
9925
 
+            b'\xa6\xa0\x0f\x50' b'\xa0\x7e\xae\x32' \
9926
 
+            b'\xd2\x00\x88\x31' b'\x88\x08\xaa\x48' \
9927
 
+            b'\x2b\x5e\x16\x55' b'\xbb\xe8\x84\x4f' \
9928
 
+            b'\xe7\xea\xd5\x54' b'\x4e\xad\x2a\x37' \
9929
 
+            b'\xcc\x65\xcc\x44' b'\xe9\xc0\x3c\x17' \
9930
 
+            b'\xff\xb2\x9f\x2e' b'\xc9\x48\xbd\x63' \
9931
 
+            b'\x35\x69\xb0\x11' b'\x7c\xd0\xe7\x35' \
9932
 
+            b'\xdc\xfe\x03\x2f' b'\xc3\x89\x13\x55' \
9933
 
+            b'\x07\x73\x74\x22' b'\x08\x7c\x0b\x61' \
9934
 
+            b'\x0b\x33\x9c\x34' b'\x88\xfb\xef\x66' \
9935
 
+            b'\x98\xb5\xb3\x47' b'\xfe\x74\x8c\x03' \
9936
 
+            b'\x83\x28\x99\x37' b'\xfb\xf2\x03\x1b' \
9937
 
+            b'\xc8\xf8\x13\x6e' b'\x5c\x45\x11\x5b' \
9938
 
+            b'\x2e\xa2\x7f\x7a' b'\xe3\xf1\x70\x5b' \
9939
 
+            b'\x70\x00\xfe\x07' b'\x77\xfc\x39\x36' \
9940
 
+            b'\x41\xd4\x4b\x13' b'\x5f\xc0\x03\x7c' \
9941
 
+            b'\xc7\xfe\xc7\x5d' b'\x50\x88\xc7\x21' \
9942
 
+            b'\xae\x98\x15\x53' b'\x7c\x38\xf6\x53' \
9943
 
+            b'\x6e\xf8\xff\x5f' b'\xa9\x87\x57\x17' \
9944
 
+            b'\x20\x7c\x5c\x14' b'\x23\xef\xe2\x1c'
9945
 
 
9946
 
 
9947
 
     def testPackRequest0(self):
9948
 
-        bin = apply(request.GetKeyboardMapping._request.to_binary, (), self.req_args_0)
9949
 
+        bin = request.GetKeyboardMapping._request.to_binary(*(), **self.req_args_0)
9950
 
         try:
9951
 
             assert bin == self.req_bin_0
9952
 
         except AssertionError:
9953
 
@@ -4804,7 +4812,7 @@
9954
 
             raise AssertionError(args)
9955
 
 
9956
 
     def testPackReply0(self):
9957
 
-        bin = apply(request.GetKeyboardMapping._reply.to_binary, (), self.reply_args_0)
9958
 
+        bin = request.GetKeyboardMapping._reply.to_binary(*(), **self.reply_args_0)
9959
 
         try:
9960
 
             assert bin == self.reply_bin_0
9961
 
         except AssertionError:
9962
 
@@ -4827,15 +4835,15 @@
9963
 
         self.req_args_0 = {
9964
 
             'attrs': {'led': 241, 'key': 193, 'bell_duration': -19485, 'auto_repeat_mode': 0, 'bell_pitch': -13220, 'key_click_percent': -3, 'bell_percent': -74, 'led_mode': 1},
9965
 
             }
9966
 
-        self.req_bin_0 = '\x66\x00\x0a\x00' '\xff\x00\x00\x00' \
9967
 
-            '\xfd\x00\x00\x00' '\xb6\x00\x00\x00' \
9968
 
-            '\x5c\xcc\x00\x00' '\xe3\xb3\x00\x00' \
9969
 
-            '\xf1\x00\x00\x00' '\x01\x00\x00\x00' \
9970
 
-            '\xc1\x00\x00\x00' '\x00\x00\x00\x00'
9971
 
+        self.req_bin_0 = b'\x66\x00\x0a\x00' b'\xff\x00\x00\x00' \
9972
 
+            b'\xfd\x00\x00\x00' b'\xb6\x00\x00\x00' \
9973
 
+            b'\x5c\xcc\x00\x00' b'\xe3\xb3\x00\x00' \
9974
 
+            b'\xf1\x00\x00\x00' b'\x01\x00\x00\x00' \
9975
 
+            b'\xc1\x00\x00\x00' b'\x00\x00\x00\x00'
9976
 
 
9977
 
 
9978
 
     def testPackRequest0(self):
9979
 
-        bin = apply(request.ChangeKeyboardControl._request.to_binary, (), self.req_args_0)
9980
 
+        bin = request.ChangeKeyboardControl._request.to_binary(*(), **self.req_args_0)
9981
 
         try:
9982
 
             assert bin == self.req_bin_0
9983
 
         except AssertionError:
9984
 
@@ -4857,7 +4865,7 @@
9985
 
     def setUp(self):
9986
 
         self.req_args_0 = {
9987
 
             }
9988
 
-        self.req_bin_0 = '\x67\x00\x01\x00'
9989
 
+        self.req_bin_0 = b'\x67\x00\x01\x00'
9990
 
 
9991
 
         self.reply_args_0 = {
9992
 
             'led_mask': 1389423883,
9993
 
@@ -4869,17 +4877,17 @@
9994
 
             'sequence_number': 62321,
9995
 
             'key_click_percent': 140,
9996
 
             }
9997
 
-        self.reply_bin_0 = '\x01\x01\x71\xf3' '\x05\x00\x00\x00' \
9998
 
-            '\x0b\xed\xd0\x52' '\x8c\x82\xb8\x6b' \
9999
 
-            '\xca\x66\x00\x00' '\x81\xd3\xb4\xca' \
10000
 
-            '\xda\x91\x81\x88' '\x89\xa5\xd2\xa0' \
10001
 
-            '\xe5\xdf\xe2\x82' '\xc5\xe9\xbb\xa6' \
10002
 
-            '\xd3\xf1\xad\xb7' '\xb8\xd8\xd8\xda' \
10003
 
-            '\xb6\xe0\xaf\xd2'
10004
 
+        self.reply_bin_0 = b'\x01\x01\x71\xf3' b'\x05\x00\x00\x00' \
10005
 
+            b'\x0b\xed\xd0\x52' b'\x8c\x82\xb8\x6b' \
10006
 
+            b'\xca\x66\x00\x00' b'\x81\xd3\xb4\xca' \
10007
 
+            b'\xda\x91\x81\x88' b'\x89\xa5\xd2\xa0' \
10008
 
+            b'\xe5\xdf\xe2\x82' b'\xc5\xe9\xbb\xa6' \
10009
 
+            b'\xd3\xf1\xad\xb7' b'\xb8\xd8\xd8\xda' \
10010
 
+            b'\xb6\xe0\xaf\xd2'
10011
 
 
10012
 
 
10013
 
     def testPackRequest0(self):
10014
 
-        bin = apply(request.GetKeyboardControl._request.to_binary, (), self.req_args_0)
10015
 
+        bin = request.GetKeyboardControl._request.to_binary(*(), **self.req_args_0)
10016
 
         try:
10017
 
             assert bin == self.req_bin_0
10018
 
         except AssertionError:
10019
 
@@ -4897,7 +4905,7 @@
10020
 
             raise AssertionError(args)
10021
 
 
10022
 
     def testPackReply0(self):
10023
 
-        bin = apply(request.GetKeyboardControl._reply.to_binary, (), self.reply_args_0)
10024
 
+        bin = request.GetKeyboardControl._reply.to_binary(*(), **self.reply_args_0)
10025
 
         try:
10026
 
             assert bin == self.reply_bin_0
10027
 
         except AssertionError:
10028
 
@@ -4920,11 +4928,11 @@
10029
 
         self.req_args_0 = {
10030
 
             'percent': -14,
10031
 
             }
10032
 
-        self.req_bin_0 = '\x68\xf2\x01\x00'
10033
 
+        self.req_bin_0 = b'\x68\xf2\x01\x00'
10034
 
 
10035
 
 
10036
 
     def testPackRequest0(self):
10037
 
-        bin = apply(request.Bell._request.to_binary, (), self.req_args_0)
10038
 
+        bin = request.Bell._request.to_binary(*(), **self.req_args_0)
10039
 
         try:
10040
 
             assert bin == self.req_bin_0
10041
 
         except AssertionError:
10042
 
@@ -4951,12 +4959,12 @@
10043
 
             'accel_denum': -24572,
10044
 
             'do_thresh': 1,
10045
 
             }
10046
 
-        self.req_bin_0 = '\x69\x00\x03\x00' '\x4e\xea\x04\xa0' \
10047
 
-            '\xba\xd6\x01\x01'
10048
 
+        self.req_bin_0 = b'\x69\x00\x03\x00' b'\x4e\xea\x04\xa0' \
10049
 
+            b'\xba\xd6\x01\x01'
10050
 
 
10051
 
 
10052
 
     def testPackRequest0(self):
10053
 
-        bin = apply(request.ChangePointerControl._request.to_binary, (), self.req_args_0)
10054
 
+        bin = request.ChangePointerControl._request.to_binary(*(), **self.req_args_0)
10055
 
         try:
10056
 
             assert bin == self.req_bin_0
10057
 
         except AssertionError:
10058
 
@@ -4978,7 +4986,7 @@
10059
 
     def setUp(self):
10060
 
         self.req_args_0 = {
10061
 
             }
10062
 
-        self.req_bin_0 = '\x6a\x00\x01\x00'
10063
 
+        self.req_bin_0 = b'\x6a\x00\x01\x00'
10064
 
 
10065
 
         self.reply_args_0 = {
10066
 
             'accel_num': 11888,
10067
 
@@ -4986,14 +4994,14 @@
10068
 
             'sequence_number': 62480,
10069
 
             'accel_denom': 46073,
10070
 
             }
10071
 
-        self.reply_bin_0 = '\x01\x00\x10\xf4' '\x00\x00\x00\x00' \
10072
 
-            '\x70\x2e\xf9\xb3' '\xd6\x8f\x00\x00' \
10073
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10074
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
10075
 
+        self.reply_bin_0 = b'\x01\x00\x10\xf4' b'\x00\x00\x00\x00' \
10076
 
+            b'\x70\x2e\xf9\xb3' b'\xd6\x8f\x00\x00' \
10077
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10078
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
10079
 
 
10080
 
 
10081
 
     def testPackRequest0(self):
10082
 
-        bin = apply(request.GetPointerControl._request.to_binary, (), self.req_args_0)
10083
 
+        bin = request.GetPointerControl._request.to_binary(*(), **self.req_args_0)
10084
 
         try:
10085
 
             assert bin == self.req_bin_0
10086
 
         except AssertionError:
10087
 
@@ -5011,7 +5019,7 @@
10088
 
             raise AssertionError(args)
10089
 
 
10090
 
     def testPackReply0(self):
10091
 
-        bin = apply(request.GetPointerControl._reply.to_binary, (), self.reply_args_0)
10092
 
+        bin = request.GetPointerControl._reply.to_binary(*(), **self.reply_args_0)
10093
 
         try:
10094
 
             assert bin == self.reply_bin_0
10095
 
         except AssertionError:
10096
 
@@ -5037,12 +5045,12 @@
10097
 
             'timeout': -2423,
10098
 
             'allow_exposures': 2,
10099
 
             }
10100
 
-        self.req_bin_0 = '\x6b\x00\x03\x00' '\x89\xf6\xee\xb4' \
10101
 
-            '\x01\x02\x00\x00'
10102
 
+        self.req_bin_0 = b'\x6b\x00\x03\x00' b'\x89\xf6\xee\xb4' \
10103
 
+            b'\x01\x02\x00\x00'
10104
 
 
10105
 
 
10106
 
     def testPackRequest0(self):
10107
 
-        bin = apply(request.SetScreenSaver._request.to_binary, (), self.req_args_0)
10108
 
+        bin = request.SetScreenSaver._request.to_binary(*(), **self.req_args_0)
10109
 
         try:
10110
 
             assert bin == self.req_bin_0
10111
 
         except AssertionError:
10112
 
@@ -5064,7 +5072,7 @@
10113
 
     def setUp(self):
10114
 
         self.req_args_0 = {
10115
 
             }
10116
 
-        self.req_bin_0 = '\x6c\x00\x01\x00'
10117
 
+        self.req_bin_0 = b'\x6c\x00\x01\x00'
10118
 
 
10119
 
         self.reply_args_0 = {
10120
 
             'interval': 51464,
10121
 
@@ -5073,14 +5081,14 @@
10122
 
             'sequence_number': 45153,
10123
 
             'allow_exposures': 1,
10124
 
             }
10125
 
-        self.reply_bin_0 = '\x01\x00\x61\xb0' '\x00\x00\x00\x00' \
10126
 
-            '\x57\x14\x08\xc9' '\x01\x01\x00\x00' \
10127
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10128
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
10129
 
+        self.reply_bin_0 = b'\x01\x00\x61\xb0' b'\x00\x00\x00\x00' \
10130
 
+            b'\x57\x14\x08\xc9' b'\x01\x01\x00\x00' \
10131
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10132
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
10133
 
 
10134
 
 
10135
 
     def testPackRequest0(self):
10136
 
-        bin = apply(request.GetScreenSaver._request.to_binary, (), self.req_args_0)
10137
 
+        bin = request.GetScreenSaver._request.to_binary(*(), **self.req_args_0)
10138
 
         try:
10139
 
             assert bin == self.req_bin_0
10140
 
         except AssertionError:
10141
 
@@ -5098,7 +5106,7 @@
10142
 
             raise AssertionError(args)
10143
 
 
10144
 
     def testPackReply0(self):
10145
 
-        bin = apply(request.GetScreenSaver._reply.to_binary, (), self.reply_args_0)
10146
 
+        bin = request.GetScreenSaver._reply.to_binary(*(), **self.reply_args_0)
10147
 
         try:
10148
 
             assert bin == self.reply_bin_0
10149
 
         except AssertionError:
10150
 
@@ -5123,12 +5131,12 @@
10151
 
             'mode': 0,
10152
 
             'host_family': 0,
10153
 
             }
10154
 
-        self.req_bin_0 = '\x6d\x00\x03\x00' '\x00\x00\x04\x00' \
10155
 
-            '\x96\xc8\xcd\xb6'
10156
 
+        self.req_bin_0 = b'\x6d\x00\x03\x00' b'\x00\x00\x04\x00' \
10157
 
+            b'\x96\xc8\xcd\xb6'
10158
 
 
10159
 
 
10160
 
     def testPackRequest0(self):
10161
 
-        bin = apply(request.ChangeHosts._request.to_binary, (), self.req_args_0)
10162
 
+        bin = request.ChangeHosts._request.to_binary(*(), **self.req_args_0)
10163
 
         try:
10164
 
             assert bin == self.req_bin_0
10165
 
         except AssertionError:
10166
 
@@ -5150,23 +5158,23 @@
10167
 
     def setUp(self):
10168
 
         self.req_args_0 = {
10169
 
             }
10170
 
-        self.req_bin_0 = '\x6e\x00\x01\x00'
10171
 
+        self.req_bin_0 = b'\x6e\x00\x01\x00'
10172
 
 
10173
 
         self.reply_args_0 = {
10174
 
             'hosts': [{'name': [34, 23, 178, 12], 'family': 0}, {'name': [130, 236, 254, 15], 'family': 0}],
10175
 
             'mode': 1,
10176
 
             'sequence_number': 33455,
10177
 
             }
10178
 
-        self.reply_bin_0 = '\x01\x01\xaf\x82' '\x04\x00\x00\x00' \
10179
 
-            '\x02\x00\x00\x00' '\x00\x00\x00\x00' \
10180
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10181
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10182
 
-            '\x00\x00\x04\x00' '\x22\x17\xb2\x0c' \
10183
 
-            '\x00\x00\x04\x00' '\x82\xec\xfe\x0f'
10184
 
+        self.reply_bin_0 = b'\x01\x01\xaf\x82' b'\x04\x00\x00\x00' \
10185
 
+            b'\x02\x00\x00\x00' b'\x00\x00\x00\x00' \
10186
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10187
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10188
 
+            b'\x00\x00\x04\x00' b'\x22\x17\xb2\x0c' \
10189
 
+            b'\x00\x00\x04\x00' b'\x82\xec\xfe\x0f'
10190
 
 
10191
 
 
10192
 
     def testPackRequest0(self):
10193
 
-        bin = apply(request.ListHosts._request.to_binary, (), self.req_args_0)
10194
 
+        bin = request.ListHosts._request.to_binary(*(), **self.req_args_0)
10195
 
         try:
10196
 
             assert bin == self.req_bin_0
10197
 
         except AssertionError:
10198
 
@@ -5184,7 +5192,7 @@
10199
 
             raise AssertionError(args)
10200
 
 
10201
 
     def testPackReply0(self):
10202
 
-        bin = apply(request.ListHosts._reply.to_binary, (), self.reply_args_0)
10203
 
+        bin = request.ListHosts._reply.to_binary(*(), **self.reply_args_0)
10204
 
         try:
10205
 
             assert bin == self.reply_bin_0
10206
 
         except AssertionError:
10207
 
@@ -5207,11 +5215,11 @@
10208
 
         self.req_args_0 = {
10209
 
             'mode': 1,
10210
 
             }
10211
 
-        self.req_bin_0 = '\x6f\x01\x01\x00'
10212
 
+        self.req_bin_0 = b'\x6f\x01\x01\x00'
10213
 
 
10214
 
 
10215
 
     def testPackRequest0(self):
10216
 
-        bin = apply(request.SetAccessControl._request.to_binary, (), self.req_args_0)
10217
 
+        bin = request.SetAccessControl._request.to_binary(*(), **self.req_args_0)
10218
 
         try:
10219
 
             assert bin == self.req_bin_0
10220
 
         except AssertionError:
10221
 
@@ -5234,11 +5242,11 @@
10222
 
         self.req_args_0 = {
10223
 
             'mode': 1,
10224
 
             }
10225
 
-        self.req_bin_0 = '\x70\x01\x01\x00'
10226
 
+        self.req_bin_0 = b'\x70\x01\x01\x00'
10227
 
 
10228
 
 
10229
 
     def testPackRequest0(self):
10230
 
-        bin = apply(request.SetCloseDownMode._request.to_binary, (), self.req_args_0)
10231
 
+        bin = request.SetCloseDownMode._request.to_binary(*(), **self.req_args_0)
10232
 
         try:
10233
 
             assert bin == self.req_bin_0
10234
 
         except AssertionError:
10235
 
@@ -5261,11 +5269,11 @@
10236
 
         self.req_args_0 = {
10237
 
             'resource': 1900634441,
10238
 
             }
10239
 
-        self.req_bin_0 = '\x71\x00\x02\x00' '\x49\x61\x49\x71'
10240
 
+        self.req_bin_0 = b'\x71\x00\x02\x00' b'\x49\x61\x49\x71'
10241
 
 
10242
 
 
10243
 
     def testPackRequest0(self):
10244
 
-        bin = apply(request.KillClient._request.to_binary, (), self.req_args_0)
10245
 
+        bin = request.KillClient._request.to_binary(*(), **self.req_args_0)
10246
 
         try:
10247
 
             assert bin == self.req_bin_0
10248
 
         except AssertionError:
10249
 
@@ -5290,18 +5298,18 @@
10250
 
             'properties': [194806244, 1444715269, 486779871, 1850032482, 1083061497, 786546027, 807635511, 1716883082, 80335197, 1654299, 1459844212, 850673646],
10251
 
             'delta': -27029,
10252
 
             }
10253
 
-        self.req_bin_0 = '\x72\x00\x0f\x00' '\xfd\x1b\x7e\x44' \
10254
 
-            '\x0c\x00\x6b\x96' '\xe4\x81\x9c\x0b' \
10255
 
-            '\x05\x9b\x1c\x56' '\xdf\xab\x03\x1d' \
10256
 
-            '\x62\x41\x45\x6e' '\xf9\x34\x8e\x40' \
10257
 
-            '\x6b\xbd\xe1\x2e' '\x37\x8a\x23\x30' \
10258
 
-            '\x8a\x8e\x55\x66' '\x5d\xd1\xc9\x04' \
10259
 
-            '\x1b\x3e\x19\x00' '\x74\x74\x03\x57' \
10260
 
-            '\xee\x3f\xb4\x32'
10261
 
+        self.req_bin_0 = b'\x72\x00\x0f\x00' b'\xfd\x1b\x7e\x44' \
10262
 
+            b'\x0c\x00\x6b\x96' b'\xe4\x81\x9c\x0b' \
10263
 
+            b'\x05\x9b\x1c\x56' b'\xdf\xab\x03\x1d' \
10264
 
+            b'\x62\x41\x45\x6e' b'\xf9\x34\x8e\x40' \
10265
 
+            b'\x6b\xbd\xe1\x2e' b'\x37\x8a\x23\x30' \
10266
 
+            b'\x8a\x8e\x55\x66' b'\x5d\xd1\xc9\x04' \
10267
 
+            b'\x1b\x3e\x19\x00' b'\x74\x74\x03\x57' \
10268
 
+            b'\xee\x3f\xb4\x32'
10269
 
 
10270
 
 
10271
 
     def testPackRequest0(self):
10272
 
-        bin = apply(request.RotateProperties._request.to_binary, (), self.req_args_0)
10273
 
+        bin = request.RotateProperties._request.to_binary(*(), **self.req_args_0)
10274
 
         try:
10275
 
             assert bin == self.req_bin_0
10276
 
         except AssertionError:
10277
 
@@ -5324,11 +5332,11 @@
10278
 
         self.req_args_0 = {
10279
 
             'mode': 1,
10280
 
             }
10281
 
-        self.req_bin_0 = '\x73\x01\x01\x00'
10282
 
+        self.req_bin_0 = b'\x73\x01\x01\x00'
10283
 
 
10284
 
 
10285
 
     def testPackRequest0(self):
10286
 
-        bin = apply(request.ForceScreenSaver._request.to_binary, (), self.req_args_0)
10287
 
+        bin = request.ForceScreenSaver._request.to_binary(*(), **self.req_args_0)
10288
 
         try:
10289
 
             assert bin == self.req_bin_0
10290
 
         except AssertionError:
10291
 
@@ -5351,21 +5359,21 @@
10292
 
         self.req_args_0 = {
10293
 
             'map': [130, 178, 229, 218, 178],
10294
 
             }
10295
 
-        self.req_bin_0 = '\x74\x05\x03\x00' '\x82\xb2\xe5\xda' \
10296
 
-            '\xb2\x00\x00\x00'
10297
 
+        self.req_bin_0 = b'\x74\x05\x03\x00' b'\x82\xb2\xe5\xda' \
10298
 
+            b'\xb2\x00\x00\x00'
10299
 
 
10300
 
         self.reply_args_0 = {
10301
 
             'status': 145,
10302
 
             'sequence_number': 57045,
10303
 
             }
10304
 
-        self.reply_bin_0 = '\x01\x91\xd5\xde' '\x00\x00\x00\x00' \
10305
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10306
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10307
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
10308
 
+        self.reply_bin_0 = b'\x01\x91\xd5\xde' b'\x00\x00\x00\x00' \
10309
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10310
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10311
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
10312
 
 
10313
 
 
10314
 
     def testPackRequest0(self):
10315
 
-        bin = apply(request.SetPointerMapping._request.to_binary, (), self.req_args_0)
10316
 
+        bin = request.SetPointerMapping._request.to_binary(*(), **self.req_args_0)
10317
 
         try:
10318
 
             assert bin == self.req_bin_0
10319
 
         except AssertionError:
10320
 
@@ -5383,7 +5391,7 @@
10321
 
             raise AssertionError(args)
10322
 
 
10323
 
     def testPackReply0(self):
10324
 
-        bin = apply(request.SetPointerMapping._reply.to_binary, (), self.reply_args_0)
10325
 
+        bin = request.SetPointerMapping._reply.to_binary(*(), **self.reply_args_0)
10326
 
         try:
10327
 
             assert bin == self.reply_bin_0
10328
 
         except AssertionError:
10329
 
@@ -5405,21 +5413,21 @@
10330
 
     def setUp(self):
10331
 
         self.req_args_0 = {
10332
 
             }
10333
 
-        self.req_bin_0 = '\x75\x00\x01\x00'
10334
 
+        self.req_bin_0 = b'\x75\x00\x01\x00'
10335
 
 
10336
 
         self.reply_args_0 = {
10337
 
             'map': [248, 185, 227, 157, 133],
10338
 
             'sequence_number': 20072,
10339
 
             }
10340
 
-        self.reply_bin_0 = '\x01\x05\x68\x4e' '\x02\x00\x00\x00' \
10341
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10342
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10343
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10344
 
-            '\xf8\xb9\xe3\x9d' '\x85\x00\x00\x00'
10345
 
+        self.reply_bin_0 = b'\x01\x05\x68\x4e' b'\x02\x00\x00\x00' \
10346
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10347
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10348
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10349
 
+            b'\xf8\xb9\xe3\x9d' b'\x85\x00\x00\x00'
10350
 
 
10351
 
 
10352
 
     def testPackRequest0(self):
10353
 
-        bin = apply(request.GetPointerMapping._request.to_binary, (), self.req_args_0)
10354
 
+        bin = request.GetPointerMapping._request.to_binary(*(), **self.req_args_0)
10355
 
         try:
10356
 
             assert bin == self.req_bin_0
10357
 
         except AssertionError:
10358
 
@@ -5437,7 +5445,7 @@
10359
 
             raise AssertionError(args)
10360
 
 
10361
 
     def testPackReply0(self):
10362
 
-        bin = apply(request.GetPointerMapping._reply.to_binary, (), self.reply_args_0)
10363
 
+        bin = request.GetPointerMapping._reply.to_binary(*(), **self.reply_args_0)
10364
 
         try:
10365
 
             assert bin == self.reply_bin_0
10366
 
         except AssertionError:
10367
 
@@ -5460,22 +5468,22 @@
10368
 
         self.req_args_0 = {
10369
 
             'keycodes': [[6, 191], [94, 123], [46, 94], [104, 116], [132, 158], [35, 75], [128, 63], [135, 221]],
10370
 
             }
10371
 
-        self.req_bin_0 = '\x76\x02\x05\x00' '\x06\xbf\x5e\x7b' \
10372
 
-            '\x2e\x5e\x68\x74' '\x84\x9e\x23\x4b' \
10373
 
-            '\x80\x3f\x87\xdd'
10374
 
+        self.req_bin_0 = b'\x76\x02\x05\x00' b'\x06\xbf\x5e\x7b' \
10375
 
+            b'\x2e\x5e\x68\x74' b'\x84\x9e\x23\x4b' \
10376
 
+            b'\x80\x3f\x87\xdd'
10377
 
 
10378
 
         self.reply_args_0 = {
10379
 
             'status': 149,
10380
 
             'sequence_number': 26757,
10381
 
             }
10382
 
-        self.reply_bin_0 = '\x01\x95\x85\x68' '\x00\x00\x00\x00' \
10383
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10384
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10385
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00'
10386
 
+        self.reply_bin_0 = b'\x01\x95\x85\x68' b'\x00\x00\x00\x00' \
10387
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10388
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10389
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00'
10390
 
 
10391
 
 
10392
 
     def testPackRequest0(self):
10393
 
-        bin = apply(request.SetModifierMapping._request.to_binary, (), self.req_args_0)
10394
 
+        bin = request.SetModifierMapping._request.to_binary(*(), **self.req_args_0)
10395
 
         try:
10396
 
             assert bin == self.req_bin_0
10397
 
         except AssertionError:
10398
 
@@ -5493,7 +5501,7 @@
10399
 
             raise AssertionError(args)
10400
 
 
10401
 
     def testPackReply0(self):
10402
 
-        bin = apply(request.SetModifierMapping._reply.to_binary, (), self.reply_args_0)
10403
 
+        bin = request.SetModifierMapping._reply.to_binary(*(), **self.reply_args_0)
10404
 
         try:
10405
 
             assert bin == self.reply_bin_0
10406
 
         except AssertionError:
10407
 
@@ -5515,22 +5523,22 @@
10408
 
     def setUp(self):
10409
 
         self.req_args_0 = {
10410
 
             }
10411
 
-        self.req_bin_0 = '\x77\x00\x01\x00'
10412
 
+        self.req_bin_0 = b'\x77\x00\x01\x00'
10413
 
 
10414
 
         self.reply_args_0 = {
10415
 
             'keycodes': [[85, 162], [139, 194], [12, 107], [120, 193], [26, 40], [125, 221], [27, 0], [220, 78]],
10416
 
             'sequence_number': 17677,
10417
 
             }
10418
 
-        self.reply_bin_0 = '\x01\x02\x0d\x45' '\x04\x00\x00\x00' \
10419
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10420
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10421
 
-            '\x00\x00\x00\x00' '\x00\x00\x00\x00' \
10422
 
-            '\x55\xa2\x8b\xc2' '\x0c\x6b\x78\xc1' \
10423
 
-            '\x1a\x28\x7d\xdd' '\x1b\x00\xdc\x4e'
10424
 
+        self.reply_bin_0 = b'\x01\x02\x0d\x45' b'\x04\x00\x00\x00' \
10425
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10426
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10427
 
+            b'\x00\x00\x00\x00' b'\x00\x00\x00\x00' \
10428
 
+            b'\x55\xa2\x8b\xc2' b'\x0c\x6b\x78\xc1' \
10429
 
+            b'\x1a\x28\x7d\xdd' b'\x1b\x00\xdc\x4e'
10430
 
 
10431
 
 
10432
 
     def testPackRequest0(self):
10433
 
-        bin = apply(request.GetModifierMapping._request.to_binary, (), self.req_args_0)
10434
 
+        bin = request.GetModifierMapping._request.to_binary(*(), **self.req_args_0)
10435
 
         try:
10436
 
             assert bin == self.req_bin_0
10437
 
         except AssertionError:
10438
 
@@ -5548,7 +5556,7 @@
10439
 
             raise AssertionError(args)
10440
 
 
10441
 
     def testPackReply0(self):
10442
 
-        bin = apply(request.GetModifierMapping._reply.to_binary, (), self.reply_args_0)
10443
 
+        bin = request.GetModifierMapping._reply.to_binary(*(), **self.reply_args_0)
10444
 
         try:
10445
 
             assert bin == self.reply_bin_0
10446
 
         except AssertionError:
10447
 
@@ -5570,11 +5578,11 @@
10448
 
     def setUp(self):
10449
 
         self.req_args_0 = {
10450
 
             }
10451
 
-        self.req_bin_0 = '\x7f\x00\x01\x00'
10452
 
+        self.req_bin_0 = b'\x7f\x00\x01\x00'
10453
 
 
10454
 
 
10455
 
     def testPackRequest0(self):
10456
 
-        bin = apply(request.NoOperation._request.to_binary, (), self.req_args_0)
10457
 
+        bin = request.NoOperation._request.to_binary(*(), **self.req_args_0)
10458
 
         try:
10459
 
             assert bin == self.req_bin_0
10460
 
         except AssertionError:
10461
 
Index: python-xlib-0.14+20091101/Xlib/error.py
10462
 
===================================================================
10463
 
--- python-xlib-0.14+20091101.orig/Xlib/error.py        2013-10-11 14:19:21.117971349 -0400
10464
 
+++ python-xlib-0.14+20091101/Xlib/error.py     2013-10-11 14:19:21.113971349 -0400
10465
 
@@ -16,11 +16,8 @@
10466
 
 #    along with this program; if not, write to the Free Software
10467
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
10468
 
 
10469
 
-# Standard modules
10470
 
-import string
10471
 
-
10472
 
 # Xlib modules
10473
 
-import X
10474
 
+from Xlib import X
10475
 
 
10476
 
 # Xlib.protocol modules
10477
 
 from Xlib.protocol import rq
10478
 
@@ -78,7 +75,7 @@
10479
 
                   'major_opcode', 'minor_opcode'):
10480
 
             s.append('%s = %s' % (f, self._data[f]))
10481
 
 
10482
 
-        return '%s: %s' % (self.__class__, string.join(s, ', '))
10483
 
+        return '%s: %s' % (self.__class__, ', '.join(s))
10484
 
 
10485
 
 class XResourceError(XError):
10486
 
     _fields = rq.Struct( rq.Card8('type'),  # Always 0
10487
 
Index: python-xlib-0.14+20091101/Xlib/protocol/event.py
10488
 
===================================================================
10489
 
--- python-xlib-0.14+20091101.orig/Xlib/protocol/event.py       2013-10-11 14:19:21.117971349 -0400
10490
 
+++ python-xlib-0.14+20091101/Xlib/protocol/event.py    2013-10-11 14:19:21.113971349 -0400
10491
 
@@ -21,7 +21,7 @@
10492
 
 from Xlib import X
10493
 
 
10494
 
 # Xlib.protocol modules
10495
 
-import rq
10496
 
+from Xlib.protocol import rq
10497
 
 
10498
 
 
10499
 
 class AnyEvent(rq.Event):
10500
 
Index: python-xlib-0.14+20091101/Xlib/XK.py
10501
 
===================================================================
10502
 
--- python-xlib-0.14+20091101.orig/Xlib/XK.py   2013-10-11 14:19:21.117971349 -0400
10503
 
+++ python-xlib-0.14+20091101/Xlib/XK.py        2013-10-11 14:19:21.113971349 -0400
10504
 
@@ -20,7 +20,7 @@
10505
 
 # as a modular keysym definition and loading mechanism. See the keysym
10506
 
 # definition modules in the Xlib/keysymdef directory.
10507
 
 
10508
 
-from X import NoSymbol
10509
 
+from Xlib.X import NoSymbol
10510
 
 
10511
 
 def string_to_keysym(keysym):
10512
 
     '''Return the (16 bit) numeric code of keysym.
10513
 
Index: python-xlib-0.14+20091101/Xlib/ext/randr.py
10514
 
===================================================================
10515
 
--- python-xlib-0.14+20091101.orig/Xlib/ext/randr.py    2013-10-11 14:19:21.117971349 -0400
10516
 
+++ python-xlib-0.14+20091101/Xlib/ext/randr.py 2013-10-11 14:19:21.113971349 -0400
10517
 
@@ -1139,7 +1139,7 @@
10518
 
 # Initialization #
10519
 
 
10520
 
 def init(disp, info):
10521
 
-    print info.__class__
10522
 
+    print(info.__class__)
10523
 
 
10524
 
     disp.extension_add_method('display', 'xrandr_query_version', query_version)
10525
 
     disp.extension_add_method('window', 'xrandr_select_input', select_input)
10526
 
Index: python-xlib-0.14+20091101/Xlib/ext/record.py
10527
 
===================================================================
10528
 
--- python-xlib-0.14+20091101.orig/Xlib/ext/record.py   2013-10-11 14:19:21.117971349 -0400
10529
 
+++ python-xlib-0.14+20091101/Xlib/ext/record.py        2013-10-11 14:19:21.113971349 -0400
10530
 
@@ -71,7 +71,7 @@
10531
 
         return val, len(val), None
10532
 
 
10533
 
     def parse_binary_value(self, data, display, length, format):
10534
 
-        return str(data), ''
10535
 
+        return data, ''
10536
 
 
10537
 
 
10538
 
 class GetVersion(rq.ReplyRequest):
10539
 
@@ -212,7 +212,7 @@
10540
 
 
10541
 
     def __init__(self, callback, *args, **keys):
10542
 
         self._callback = callback
10543
 
-        apply(rq.ReplyRequest.__init__, (self, ) + args, keys)
10544
 
+        rq.ReplyRequest.__init__(self, *args, **keys)
10545
 
 
10546
 
     def _parse_response(self, data):
10547
 
         r, d = self._reply.parse_binary(data, self._display)
10548
 
Index: python-xlib-0.14+20091101/Xlib/xobject/colormap.py
10549
 
===================================================================
10550
 
--- python-xlib-0.14+20091101.orig/Xlib/xobject/colormap.py     2013-10-11 14:19:21.117971349 -0400
10551
 
+++ python-xlib-0.14+20091101/Xlib/xobject/colormap.py  2013-10-11 14:19:21.113971349 -0400
10552
 
@@ -18,8 +18,7 @@
10553
 
 
10554
 
 from Xlib import error
10555
 
 from Xlib.protocol import request
10556
 
-
10557
 
-import resource
10558
 
+from Xlib.xobject import resource
10559
 
 
10560
 
 import re
10561
 
 import string
10562
 
Index: python-xlib-0.14+20091101/Xlib/threaded.py
10563
 
===================================================================
10564
 
--- python-xlib-0.14+20091101.orig/Xlib/threaded.py     2013-10-11 14:19:21.117971349 -0400
10565
 
+++ python-xlib-0.14+20091101/Xlib/threaded.py  2013-10-11 14:19:21.113971349 -0400
10566
 
@@ -16,7 +16,12 @@
10567
 
 #    along with this program; if not, write to the Free Software
10568
 
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
10569
 
 
10570
 
-import thread
10571
 
+try:
10572
 
+    # Python 3
10573
 
+    import _thread as thread
10574
 
+except ImportError:
10575
 
+    # Python 2
10576
 
+    import thread
10577
 
 
10578
 
 # We change the allocate_lock function in Xlib.support.lock to
10579
 
 # return a basic Python lock, instead of the default dummy lock
10580
 
Index: python-xlib-0.14+20091101/Xlib/xobject/resource.py
10581
 
===================================================================
10582
 
--- python-xlib-0.14+20091101.orig/Xlib/xobject/resource.py     2013-10-11 14:19:21.117971349 -0400
10583
 
+++ python-xlib-0.14+20091101/Xlib/xobject/resource.py  2013-10-11 14:19:21.113971349 -0400
10584
 
@@ -27,14 +27,14 @@
10585
 
     def __resource__(self):
10586
 
         return self.id
10587
 
 
10588
 
-    def __cmp__(self, obj):
10589
 
+    def __eq__(self, obj):
10590
 
         if isinstance(obj, Resource):
10591
 
             if self.display == obj.display:
10592
 
-                return cmp(self.id, obj.id)
10593
 
+                return self.id == obj.id
10594
 
             else:
10595
 
-                return cmp(self.display, obj.display)
10596
 
+                return self.display == obj.display
10597
 
         else:
10598
 
-            return cmp(id(self), id(obj))
10599
 
+            return id(self) == id(obj)
10600
 
 
10601
 
     def __hash__(self):
10602
 
         return int(self.id)