1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
Description: do not use 'async' as a variable name
It is a keyword in Python 3.7.
Author: Michael Hudson-Doyle <michael.hudson@ubuntu.com>
Origin: vendor
Last-Update: 2018-08-02
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/aptdaemon/client.py
+++ b/aptdaemon/client.py
@@ -1567,17 +1567,17 @@
def _run_transaction(self, method_name, args, wait, reply_handler,
error_handler):
- async = reply_handler and error_handler
+ async_ = reply_handler and error_handler
try:
deferred = self._run_transaction_helper(method_name, args, wait,
- async)
+ async_)
except Exception as error:
- if async:
+ if async_:
error_handler(error)
return
else:
raise
- if async:
+ if async_:
def on_error(error):
"""Convert the DeferredException to a normal exception."""
try:
@@ -1609,10 +1609,10 @@
return trans
@defer.inline_callbacks
- def _run_transaction_helper(self, method_name, args, wait, async):
+ def _run_transaction_helper(self, method_name, args, wait, async_):
daemon = get_aptdaemon(self.bus)
dbus_method = daemon.get_dbus_method(method_name)
- if async:
+ if async_:
deferred = defer.Deferred()
dbus_method(reply_handler=deferred.callback,
error_handler=deferred.errback, *args,
@@ -1626,7 +1626,7 @@
if self.terminal:
yield trans.set_terminal(self.terminal)
yield trans.sync()
- if wait and async:
+ if wait and async_:
deferred_wait = defer.Deferred()
sig = trans.connect("finished",
lambda trans, exit:
|