Skip to content

Commit 54d7e6b

Browse files
seba-alnclient-engineering-bot
andauthored
fix deprecation of Event.isSet call (#138)
* Additional deprecation fixes * PubNub SDK 7.0.1 release. Co-authored-by: Client Engineering Bot <[email protected]>
1 parent 3e43bd5 commit 54d7e6b

File tree

6 files changed

+23
-12
lines changed

6 files changed

+23
-12
lines changed

.pubnub.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: python
2-
version: 7.0.0
2+
version: 7.0.1
33
schema: 1
44
scm: github.com/pubnub/python
55
sdks:
@@ -18,7 +18,7 @@ sdks:
1818
distributions:
1919
- distribution-type: library
2020
distribution-repository: package
21-
package-name: pubnub-7.0.0
21+
package-name: pubnub-7.0.1
2222
location: https://pypi.org/project/pubnub/
2323
supported-platforms:
2424
supported-operating-systems:
@@ -97,8 +97,8 @@ sdks:
9797
-
9898
distribution-type: library
9999
distribution-repository: git release
100-
package-name: pubnub-7.0.0
101-
location: https://github.com/pubnub/python/releases/download/7.0.0/pubnub-7.0.0.tar.gz
100+
package-name: pubnub-7.0.1
101+
location: https://github.com/pubnub/python/releases/download/7.0.1/pubnub-7.0.1.tar.gz
102102
supported-platforms:
103103
supported-operating-systems:
104104
Linux:
@@ -169,6 +169,11 @@ sdks:
169169
license-url: https://github.com/aio-libs/aiohttp/blob/master/LICENSE.txt
170170
is-required: Required
171171
changelog:
172+
- date: 2022-10-05
173+
version: 7.0.1
174+
changes:
175+
- type: bug
176+
text: "Remove deprecation warning of Event.is_set and Thread.deamon."
172177
- date: 2022-08-23
173178
version: 7.0.0
174179
changes:

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 7.0.1
2+
October 05 2022
3+
4+
#### Fixed
5+
- Remove deprecation warning of Event.is_set and Thread.deamon.
6+
17
## 7.0.0
28
August 23 2022
39

pubnub/pubnub.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _register_heartbeat_timer(self):
102102
self._recalculate_interval()
103103

104104
self._timer = threading.Timer(self._timer_interval, self._call_time)
105-
self._timer.setDaemon(True)
105+
self._timer.daemon = True
106106
self._timer.start()
107107

108108
def _call_time(self):
@@ -265,7 +265,7 @@ def _start_worker(self):
265265
target=consumer.run,
266266
name="SubscribeMessageWorker"
267267
)
268-
self._consumer_thread.setDaemon(True)
268+
self._consumer_thread.daemon = True
269269
self._consumer_thread.start()
270270

271271
def _start_subscribe_loop(self):
@@ -349,13 +349,13 @@ def _run(self):
349349

350350
def _schedule_next(self):
351351
self._timeout = threading.Timer(self._callback_time, self._run)
352-
self._timeout.setDaemon(True)
352+
self._timer.daemon = True
353353
self._timeout.start()
354354

355355

356356
class NativeSubscribeMessageWorker(SubscribeMessageWorker):
357357
def _take_message(self):
358-
while not self._event.isSet():
358+
while not self._event.is_set():
359359
try:
360360
# TODO: get rid of 1s timeout
361361
msg = self._queue.get(True, 1)

pubnub/pubnub_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383

8484
class PubNubCore:
8585
"""A base class for PubNub Python API implementations"""
86-
SDK_VERSION = "7.0.0"
86+
SDK_VERSION = "7.0.1"
8787
SDK_NAME = "PubNub-Python"
8888

8989
TIMESTAMP_DIVIDER = 1000

pubnub/request_handlers/requests_handler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def async_request(self, endpoint_name, platform_options, endpoint_call_options,
5151
def callback_to_invoke_in_separate_thread():
5252
try:
5353
envelope = self._build_envelope(platform_options, endpoint_call_options)
54-
if cancellation_event is not None and cancellation_event.isSet():
54+
if cancellation_event is not None and cancellation_event.is_set():
5555
# Since there are no way to affect on ongoing request it's response will
5656
# be just ignored on cancel call
5757
return
@@ -94,7 +94,7 @@ def execute_callback_in_separate_thread(
9494
target=client.run,
9595
name="Thread-%s-%d" % (operation_name, ++RequestsRequestHandler.ENDPOINT_THREAD_COUNTER)
9696
)
97-
thread.setDaemon(self.pubnub.config.daemon)
97+
thread.daemon = self.pubnub.config.daemon
9898
thread.start()
9999

100100
call_obj.thread = thread

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name='pubnub',
5-
version='7.0.0',
5+
version='7.0.1',
66
description='PubNub Real-time push service in the cloud',
77
author='PubNub',
88
author_email='[email protected]',

0 commit comments

Comments
 (0)