From 200a3ef4eba02779991c7783552026187531dcd9 Mon Sep 17 00:00:00 2001 From: Matthias Urlichs Date: Mon, 4 Feb 2019 20:29:34 +0100 Subject: [PATCH] replaced a bunch of map() with generator expressions --- src/octoprint/util/comm.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/octoprint/util/comm.py b/src/octoprint/util/comm.py index 69896c3e0..d3e06917b 100644 --- a/src/octoprint/util/comm.py +++ b/src/octoprint/util/comm.py @@ -2635,17 +2635,17 @@ class MachineCom(object): stripped_error = (line[6:] if lower_line.startswith("error:") else line[2:]).strip() - if any(map(lambda x: x in lower_line, self._recoverable_communication_errors)): + if any(x in lower_line for x in self._recoverable_communication_errors): # manually trigger an ack for comm errors the printer doesn't send a resend request for but # from which we can recover from by just pushing on (because that then WILL trigger a fitting # resend request) self._handle_ok() - elif any(map(lambda x: x in lower_line, self._resend_request_communication_errors)): + elif any(x in lower_line for x in self._resend_request_communication_errors): # skip comm errors that the printer sends a resend request for anyhow self._lastCommError = stripped_error - elif any(map(lambda x: x in lower_line, self._sd_card_errors)): + elif any(x in lower_line for x in self._sd_card_errors): # skip errors with the SD card pass