Skip to content

Commit

Permalink
treewide: fix remaining uses of threading camel case methods
Browse files Browse the repository at this point in the history
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] python/cpython#25174
[2] pyserial#643

Signed-off-by: Bastian Krause <[email protected]>
  • Loading branch information
Bastian-Krause committed Jan 30, 2024
1 parent 7aeea35 commit a6ad55a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion serial/rfc2217.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def open(self):
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
Expand Down
2 changes: 1 addition & 1 deletion serial/urlhandler/protocol_cp2110.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def open(self):
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):
Expand Down

0 comments on commit a6ad55a

Please sign in to comment.