Skip to content

Commit 867b69d

Browse files
committed
'apply' removed
1 parent 5de6f88 commit 867b69d

File tree

6 files changed

+414
-411
lines changed

6 files changed

+414
-411
lines changed

Xlib/display.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class _BaseDisplay(protocol.display.Display):
6262
# dealing with some ICCCM properties not defined in Xlib.Xatom
6363

6464
def __init__(self, *args, **keys):
65-
apply(protocol.display.Display.__init__, (self, ) + args, keys)
65+
protocol.display.Display.__init__(*(self, ) + args, **keys)
6666
self._atom_cache = {}
6767

6868
def get_atom(self, atomname, only_if_exists=0):

test.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
(shopt -s globstar; for s in */**.py; do timeout 1 python2 -3 "$s"; done) 2> error.log > /dev/null
3+
grep -i failed error.log && exit 1 || exit 0

test/test_events_be.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
class CmpArray:
1515
def __init__(self, *args, **kws):
16-
self.array = apply(array.array, args, kws)
16+
self.array = array.array(*args, **kws)
1717

1818
def __len__(self):
1919
return len(self.array)
@@ -73,7 +73,7 @@ def setUp(self):
7373

7474

7575
def testPack0(self):
76-
bin = apply(event.KeymapNotify._fields.to_binary, (), self.evt_args_0)
76+
bin = event.KeymapNotify._fields.to_binary(*(), **self.evt_args_0)
7777
try:
7878
assert bin == self.evt_bin_0
7979
except AssertionError:
@@ -110,7 +110,7 @@ def setUp(self):
110110

111111

112112
def testPack0(self):
113-
bin = apply(event.Expose._fields.to_binary, (), self.evt_args_0)
113+
bin = event.Expose._fields.to_binary(*(), **self.evt_args_0)
114114
try:
115115
assert bin == self.evt_bin_0
116116
except AssertionError:
@@ -149,7 +149,7 @@ def setUp(self):
149149

150150

151151
def testPack0(self):
152-
bin = apply(event.GraphicsExpose._fields.to_binary, (), self.evt_args_0)
152+
bin = event.GraphicsExpose._fields.to_binary(*(), **self.evt_args_0)
153153
try:
154154
assert bin == self.evt_bin_0
155155
except AssertionError:
@@ -183,7 +183,7 @@ def setUp(self):
183183

184184

185185
def testPack0(self):
186-
bin = apply(event.NoExpose._fields.to_binary, (), self.evt_args_0)
186+
bin = event.NoExpose._fields.to_binary(*(), **self.evt_args_0)
187187
try:
188188
assert bin == self.evt_bin_0
189189
except AssertionError:
@@ -216,7 +216,7 @@ def setUp(self):
216216

217217

218218
def testPack0(self):
219-
bin = apply(event.VisibilityNotify._fields.to_binary, (), self.evt_args_0)
219+
bin = event.VisibilityNotify._fields.to_binary(*(), **self.evt_args_0)
220220
try:
221221
assert bin == self.evt_bin_0
222222
except AssertionError:
@@ -255,7 +255,7 @@ def setUp(self):
255255

256256

257257
def testPack0(self):
258-
bin = apply(event.CreateNotify._fields.to_binary, (), self.evt_args_0)
258+
bin = event.CreateNotify._fields.to_binary(*(), **self.evt_args_0)
259259
try:
260260
assert bin == self.evt_bin_0
261261
except AssertionError:
@@ -288,7 +288,7 @@ def setUp(self):
288288

289289

290290
def testPack0(self):
291-
bin = apply(event.DestroyNotify._fields.to_binary, (), self.evt_args_0)
291+
bin = event.DestroyNotify._fields.to_binary(*(), **self.evt_args_0)
292292
try:
293293
assert bin == self.evt_bin_0
294294
except AssertionError:
@@ -322,7 +322,7 @@ def setUp(self):
322322

323323

324324
def testPack0(self):
325-
bin = apply(event.UnmapNotify._fields.to_binary, (), self.evt_args_0)
325+
bin = event.UnmapNotify._fields.to_binary(*(), **self.evt_args_0)
326326
try:
327327
assert bin == self.evt_bin_0
328328
except AssertionError:
@@ -356,7 +356,7 @@ def setUp(self):
356356

357357

358358
def testPack0(self):
359-
bin = apply(event.MapNotify._fields.to_binary, (), self.evt_args_0)
359+
bin = event.MapNotify._fields.to_binary(*(), **self.evt_args_0)
360360
try:
361361
assert bin == self.evt_bin_0
362362
except AssertionError:
@@ -389,7 +389,7 @@ def setUp(self):
389389

390390

391391
def testPack0(self):
392-
bin = apply(event.MapRequest._fields.to_binary, (), self.evt_args_0)
392+
bin = event.MapRequest._fields.to_binary(*(), **self.evt_args_0)
393393
try:
394394
assert bin == self.evt_bin_0
395395
except AssertionError:
@@ -426,7 +426,7 @@ def setUp(self):
426426

427427

428428
def testPack0(self):
429-
bin = apply(event.ReparentNotify._fields.to_binary, (), self.evt_args_0)
429+
bin = event.ReparentNotify._fields.to_binary(*(), **self.evt_args_0)
430430
try:
431431
assert bin == self.evt_bin_0
432432
except AssertionError:
@@ -466,7 +466,7 @@ def setUp(self):
466466

467467

468468
def testPack0(self):
469-
bin = apply(event.ConfigureNotify._fields.to_binary, (), self.evt_args_0)
469+
bin = event.ConfigureNotify._fields.to_binary(*(), **self.evt_args_0)
470470
try:
471471
assert bin == self.evt_bin_0
472472
except AssertionError:
@@ -507,7 +507,7 @@ def setUp(self):
507507

508508

509509
def testPack0(self):
510-
bin = apply(event.ConfigureRequest._fields.to_binary, (), self.evt_args_0)
510+
bin = event.ConfigureRequest._fields.to_binary(*(), **self.evt_args_0)
511511
try:
512512
assert bin == self.evt_bin_0
513513
except AssertionError:
@@ -542,7 +542,7 @@ def setUp(self):
542542

543543

544544
def testPack0(self):
545-
bin = apply(event.GravityNotify._fields.to_binary, (), self.evt_args_0)
545+
bin = event.GravityNotify._fields.to_binary(*(), **self.evt_args_0)
546546
try:
547547
assert bin == self.evt_bin_0
548548
except AssertionError:
@@ -576,7 +576,7 @@ def setUp(self):
576576

577577

578578
def testPack0(self):
579-
bin = apply(event.ResizeRequest._fields.to_binary, (), self.evt_args_0)
579+
bin = event.ResizeRequest._fields.to_binary(*(), **self.evt_args_0)
580580
try:
581581
assert bin == self.evt_bin_0
582582
except AssertionError:
@@ -611,7 +611,7 @@ def setUp(self):
611611

612612

613613
def testPack0(self):
614-
bin = apply(event.PropertyNotify._fields.to_binary, (), self.evt_args_0)
614+
bin = event.PropertyNotify._fields.to_binary(*(), **self.evt_args_0)
615615
try:
616616
assert bin == self.evt_bin_0
617617
except AssertionError:
@@ -645,7 +645,7 @@ def setUp(self):
645645

646646

647647
def testPack0(self):
648-
bin = apply(event.SelectionClear._fields.to_binary, (), self.evt_args_0)
648+
bin = event.SelectionClear._fields.to_binary(*(), **self.evt_args_0)
649649
try:
650650
assert bin == self.evt_bin_0
651651
except AssertionError:
@@ -682,7 +682,7 @@ def setUp(self):
682682

683683

684684
def testPack0(self):
685-
bin = apply(event.SelectionRequest._fields.to_binary, (), self.evt_args_0)
685+
bin = event.SelectionRequest._fields.to_binary(*(), **self.evt_args_0)
686686
try:
687687
assert bin == self.evt_bin_0
688688
except AssertionError:
@@ -718,7 +718,7 @@ def setUp(self):
718718

719719

720720
def testPack0(self):
721-
bin = apply(event.SelectionNotify._fields.to_binary, (), self.evt_args_0)
721+
bin = event.SelectionNotify._fields.to_binary(*(), **self.evt_args_0)
722722
try:
723723
assert bin == self.evt_bin_0
724724
except AssertionError:
@@ -753,7 +753,7 @@ def setUp(self):
753753

754754

755755
def testPack0(self):
756-
bin = apply(event.ColormapNotify._fields.to_binary, (), self.evt_args_0)
756+
bin = event.ColormapNotify._fields.to_binary(*(), **self.evt_args_0)
757757
try:
758758
assert bin == self.evt_bin_0
759759
except AssertionError:
@@ -811,7 +811,7 @@ def setUp(self):
811811

812812

813813
def testPack0(self):
814-
bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_0)
814+
bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_0)
815815
try:
816816
assert bin == self.evt_bin_0
817817
except AssertionError:
@@ -829,7 +829,7 @@ def testUnpack0(self):
829829
raise AssertionError(args)
830830

831831
def testPack1(self):
832-
bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_1)
832+
bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_1)
833833
try:
834834
assert bin == self.evt_bin_1
835835
except AssertionError:
@@ -847,7 +847,7 @@ def testUnpack1(self):
847847
raise AssertionError(args)
848848

849849
def testPack2(self):
850-
bin = apply(event.ClientMessage._fields.to_binary, (), self.evt_args_2)
850+
bin = event.ClientMessage._fields.to_binary(*(), **self.evt_args_2)
851851
try:
852852
assert bin == self.evt_bin_2
853853
except AssertionError:
@@ -881,7 +881,7 @@ def setUp(self):
881881

882882

883883
def testPack0(self):
884-
bin = apply(event.MappingNotify._fields.to_binary, (), self.evt_args_0)
884+
bin = event.MappingNotify._fields.to_binary(*(), **self.evt_args_0)
885885
try:
886886
assert bin == self.evt_bin_0
887887
except AssertionError:

0 commit comments

Comments
 (0)