diff --git a/source/RPIO/_RPIO.py b/source/RPIO/_RPIO.py index 87651d4..019c80d 100644 --- a/source/RPIO/_RPIO.py +++ b/source/RPIO/_RPIO.py @@ -350,7 +350,7 @@ def cleanup_tcpsockets(self): """ Closes all TCP connections and then the socket servers """ - for fileno in self._tcp_client_sockets.keys(): + for fileno in list(self._tcp_client_sockets.keys()): self.close_tcp_client(fileno) for fileno, items in self._tcp_server_sockets.items(): socket, cb = items