Skip to content

Commit 2ebab04

Browse files
authored
prepare 6.9.3 release (#126)
1 parent caa1ae1 commit 2ebab04

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

ldclient/client.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def __init__(self, sdk_key=None, config=None, start_wait=5):
8282
"Only one of either is expected")
8383

8484
if sdk_key is not None:
85-
log.warn("Deprecated sdk_key argument was passed to init. Use config object instead.")
85+
log.warning("Deprecated sdk_key argument was passed to init. Use config object instead.")
8686
self._config = Config(sdk_key=sdk_key)
8787
else:
8888
self._config = config or Config.default()
@@ -113,7 +113,7 @@ def __init__(self, sdk_key=None, config=None, start_wait=5):
113113
if self._update_processor.initialized() is True:
114114
log.info("Started LaunchDarkly Client: OK")
115115
else:
116-
log.warn("Initialization timeout exceeded for LaunchDarkly Client or an error occurred. "
116+
log.warning("Initialization timeout exceeded for LaunchDarkly Client or an error occurred. "
117117
"Feature Flags may not yet be available.")
118118

119119
def _make_event_processor(self, config):
@@ -139,7 +139,7 @@ def _make_update_processor(self, config, store, ready):
139139
return StreamingUpdateProcessor(config, feature_requester, store, ready)
140140

141141
log.info("Disabling streaming API")
142-
log.warn("You should only disable the streaming API if instructed to do so by LaunchDarkly support")
142+
log.warning("You should only disable the streaming API if instructed to do so by LaunchDarkly support")
143143
return PollingUpdateProcessor(config, feature_requester, store, ready)
144144

145145
def get_sdk_key(self):
@@ -180,7 +180,7 @@ def track(self, event_name, user, data=None):
180180
:param data: optional additional data associated with the event
181181
"""
182182
if user is None or user.get('key') is None:
183-
log.warn("Missing user or user key when calling track().")
183+
log.warning("Missing user or user key when calling track().")
184184
else:
185185
self._send_event({'kind': 'custom', 'key': event_name, 'user': user, 'data': data})
186186

@@ -194,7 +194,7 @@ def identify(self, user):
194194
:param dict user: attributes of the user to register
195195
"""
196196
if user is None or user.get('key') is None:
197-
log.warn("Missing user or user key when calling identify().")
197+
log.warning("Missing user or user key when calling identify().")
198198
else:
199199
self._send_event({'kind': 'identify', 'key': str(user.get('key')), 'user': user})
200200

@@ -234,7 +234,7 @@ def toggle(self, key, user, default):
234234
235235
.. deprecated:: 2.0.0
236236
"""
237-
log.warn("Deprecated method: toggle() called. Use variation() instead.")
237+
log.warning("Deprecated method: toggle() called. Use variation() instead.")
238238
return self.variation(key, user, default)
239239

240240
def variation(self, key, user, default):
@@ -281,16 +281,16 @@ def send_event(value, variation=None, flag=None, reason=None):
281281

282282
if not self.is_initialized():
283283
if self._store.initialized:
284-
log.warn("Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: " + key)
284+
log.warning("Feature Flag evaluation attempted before client has initialized - using last known values from feature store for feature key: " + key)
285285
else:
286-
log.warn("Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: "
286+
log.warning("Feature Flag evaluation attempted before client has initialized! Feature store unavailable - returning default: "
287287
+ str(default) + " for feature key: " + key)
288288
reason = error_reason('CLIENT_NOT_READY')
289289
send_event(default, None, None, reason)
290290
return EvaluationDetail(default, None, reason)
291291

292292
if user is not None and user.get('key', "") == "":
293-
log.warn("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly.")
293+
log.warning("User key is blank. Flag evaluation will proceed, but the user will not be stored in LaunchDarkly.")
294294

295295
try:
296296
flag = self._store.get(FEATURES, key, lambda x: x)
@@ -369,18 +369,18 @@ def all_flags_state(self, user, **kwargs):
369369
:rtype: FeatureFlagsState
370370
"""
371371
if self._config.offline:
372-
log.warn("all_flags_state() called, but client is in offline mode. Returning empty state")
372+
log.warning("all_flags_state() called, but client is in offline mode. Returning empty state")
373373
return FeatureFlagsState(False)
374374

375375
if not self.is_initialized():
376376
if self._store.initialized:
377-
log.warn("all_flags_state() called before client has finished initializing! Using last known values from feature store")
377+
log.warning("all_flags_state() called before client has finished initializing! Using last known values from feature store")
378378
else:
379-
log.warn("all_flags_state() called before client has finished initializing! Feature store unavailable - returning empty state")
379+
log.warning("all_flags_state() called before client has finished initializing! Feature store unavailable - returning empty state")
380380
return FeatureFlagsState(False)
381381

382382
if user is None or user.get('key') is None:
383-
log.warn("User or user key is None when calling all_flags_state(). Returning empty state.")
383+
log.warning("User or user key is None when calling all_flags_state(). Returning empty state.")
384384
return FeatureFlagsState(False)
385385

386386
state = FeatureFlagsState(True)

ldclient/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,4 +280,4 @@ def inline_users_in_events(self):
280280

281281
def _validate(self):
282282
if self.offline is False and self.sdk_key is None or self.sdk_key is '':
283-
log.warn("Missing or blank sdk_key.")
283+
log.warning("Missing or blank sdk_key.")

ldclient/flag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def _check_prerequisites(flag, user, store, events, include_reasons_in_events):
147147
for prereq in flag.get('prerequisites') or []:
148148
prereq_flag = store.get(FEATURES, prereq.get('key'), lambda x: x)
149149
if prereq_flag is None:
150-
log.warn("Missing prereq flag: " + prereq.get('key'))
150+
log.warning("Missing prereq flag: " + prereq.get('key'))
151151
failed_prereq = prereq
152152
else:
153153
prereq_res = _evaluate(prereq_flag, user, store, events, include_reasons_in_events)

ldclient/impl/integrations/files/file_data_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def _start_auto_updater(self):
107107
try:
108108
resolved_paths.append(os.path.realpath(path))
109109
except:
110-
log.warn('Cannot watch for changes to data file "%s" because it is an invalid path' % path)
110+
log.warning('Cannot watch for changes to data file "%s" because it is an invalid path' % path)
111111
if have_watchdog and not self._force_polling:
112112
return _FileDataSource.WatchdogAutoUpdater(resolved_paths, self._load_all)
113113
else:

ldclient/operators.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def _string_operator(u, c, fn):
2727
def _numeric_operator(u, c, fn):
2828
# bool is a subtype of int, and we don't want to try and compare it as a number.
2929
if isinstance(input, bool):
30-
log.warn("Got unexpected bool type when attempting to parse time")
30+
log.warning("Got unexpected bool type when attempting to parse time")
3131
return None
3232

3333
if isinstance(u, Number):
@@ -44,7 +44,7 @@ def _parse_time(input):
4444

4545
# bool is a subtype of int, and we don't want to try and compare it as a time.
4646
if isinstance(input, bool):
47-
log.warn("Got unexpected bool type when attempting to parse time")
47+
log.warning("Got unexpected bool type when attempting to parse time")
4848
return None
4949

5050
if isinstance(input, Number):
@@ -56,10 +56,10 @@ def _parse_time(input):
5656
timestamp = (parsed_time - epoch).total_seconds()
5757
return timestamp * 1000.0
5858
except Exception as e:
59-
log.warn("Couldn't parse timestamp:" + str(input) + " with message: " + str(e))
59+
log.warning("Couldn't parse timestamp:" + str(input) + " with message: " + str(e))
6060
return None
6161

62-
log.warn("Got unexpected type: " + type(input) + " with value: " + str(input) + " when attempting to parse time")
62+
log.warning("Got unexpected type: " + type(input) + " with value: " + str(input) + " when attempting to parse time")
6363
return None
6464

6565
def _time_operator(u, c, fn):

ldclient/sse_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
import re
99
import time
10-
import warnings
1110

1211
import six
1312

1413
import urllib3
1514

1615
from ldclient.util import create_http_pool_manager
16+
from ldclient.util import log
1717
from ldclient.util import throw_if_unsuccessful_response
1818

1919
# Technically, we should support streams that mix line endings. This regex,
@@ -158,7 +158,7 @@ def parse(cls, raw):
158158
m = cls.sse_line_pattern.match(line)
159159
if m is None:
160160
# Malformed line. Discard but warn.
161-
warnings.warn('Invalid SSE line: "%s"' % line, SyntaxWarning)
161+
log.warning('Invalid SSE line: "%s"' % line)
162162
continue
163163

164164
name = m.groupdict()['name']

0 commit comments

Comments
 (0)