[tor-commits] [stem/master] Replace print function with lambda
atagar at torproject.org
atagar at torproject.org
Sun Jan 5 21:39:28 UTC 2020
commit ef177c52569d1fbcce8f3203d111c2b74fe5e0db
Author: Damian Johnson <atagar at torproject.org>
Date: Sun Jan 5 12:36:59 2020 -0800
Replace print function with lambda
---
stem/interpreter/__init__.py | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/stem/interpreter/__init__.py b/stem/interpreter/__init__.py
index fc0c2cf3..67984261 100644
--- a/stem/interpreter/__init__.py
+++ b/stem/interpreter/__init__.py
@@ -127,14 +127,7 @@ def main():
if args.run_cmd:
if args.run_cmd.upper().startswith('SETEVENTS '):
- # TODO: we can use a lambda here when dropping python 2.x support, but
- # until then print's status as a keyword prevents it from being used in
- # lambdas
-
- def handle_event(event_message):
- print(format(str(event_message), *STANDARD_OUTPUT))
-
- controller._handle_event = handle_event
+ controller._handle_event = lambda event_message: print(format(str(event_message), *STANDARD_OUTPUT))
if sys.stdout.isatty():
events = args.run_cmd.upper().split(' ', 1)[1]
More information about the tor-commits
mailing list