treewide: fix remaining uses of threading camel case methods The threading camel case methods were deprecated in [1]. A previous pyserial PR [2] fixed a bunch of these warnings, but missed a few. Fix the remaining setName() DeprecationWarnings by using the appropriate name attribute instead. [1] https://github.com/python/cpython/pull/25174 [2] https://github.com/pyserial/pyserial/pull/643 Signed-off-by: Bastian Krause <bst@pengutronix.de>
diff --git a/serial/rfc2217.py b/serial/rfc2217.py index c52bf52..caedea4 100644 --- a/serial/rfc2217.py +++ b/serial/rfc2217.py
@@ -461,7 +461,7 @@ self.is_open = True self._thread = threading.Thread(target=self._telnet_read_loop) self._thread.daemon = True - self._thread.setName('pySerial RFC 2217 reader thread for {}'.format(self._port)) + self._thread.name = 'pySerial RFC 2217 reader thread for {}'.format(self._port) self._thread.start() try: # must clean-up if open fails
diff --git a/serial/urlhandler/protocol_cp2110.py b/serial/urlhandler/protocol_cp2110.py index ce5b037..620162f 100644 --- a/serial/urlhandler/protocol_cp2110.py +++ b/serial/urlhandler/protocol_cp2110.py
@@ -100,7 +100,7 @@ self.is_open = True self._thread = threading.Thread(target=self._hid_read_loop) self._thread.daemon = True - self._thread.setName('pySerial CP2110 reader thread for {}'.format(self._port)) + self._thread.name = 'pySerial CP2110 reader thread for {}'.format(self._port) self._thread.start() def from_url(self, url):