From: Roger Light Date: Sat, 22 Jun 2013 21:11:47 +0000 (+0100) Subject: Auto generate client id if it is None as well as "". X-Git-Tag: v0.9~65 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=d5c238872a0ca313df0f5bdab99b210e9be805f3;p=packages%2Fp%2Fpaho-mqtt.git Auto generate client id if it is None as well as "". --- diff --git a/src/paho/mqtt/client.py b/src/paho/mqtt/client.py index 564d111..fabef9b 100755 --- a/src/paho/mqtt/client.py +++ b/src/paho/mqtt/client.py @@ -377,7 +377,7 @@ class Client: self._message_retry = 20 self._last_retry_check = 0 self._clean_session = clean_session - if client_id == "": + if client_id == "" or client_id == None: self._client_id = "paho/" + "".join(random.choice("0123456789ADCDEF") for x in range(23-5)) else: self._client_id = client_id