Skip to content

Commit 093e4c5

Browse files
committed
remove python2 code
1 parent 1c0cab0 commit 093e4c5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

AWSIoTPythonSDK/core/protocol/paho/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,6 @@ def publish(self, topic, payload=None, qos=0, retain=False):
984984
# Client.publish() now accepts bytes() payloads on Python 3.
985985
elif sys.version_info[0] == 3 and isinstance(payload, bytes):
986986
local_payload = bytearray(payload)
987-
elif sys.version_info[0] < 3 and isinstance(payload, unicode):
988-
local_payload = payload
989987
elif isinstance(payload, int) or isinstance(payload, float):
990988
local_payload = str(payload)
991989
elif payload is None:
@@ -1050,12 +1048,14 @@ def username_pw_set(self, username, password=None):
10501048
Requires a broker that supports MQTT v3.1.
10511049
10521050
username: The username to authenticate with. Need have no relationship to the client id.
1051+
[MQTT-3.1.3-11].
1052+
Set to None to reset client back to not using username/password for broker authentication.
10531053
password: The password to authenticate with. Optional, set to None if not required.
10541054
"""
10551055
# [MQTT-3.1.3-11] User name must be UTF-8 encoded string
10561056
self._username = None if username is None else username.encode('utf-8')
10571057
self._password = password
1058-
if isinstance(self._password, unicode):
1058+
if isinstance(self._password, str):
10591059
self._password = self._password.encode('utf-8')
10601060

10611061
def socket_factory_set(self, socket_factory):

0 commit comments

Comments
 (0)