Skip to content

Commit 4f91e5f

Browse files
nelz9999haotianw465
authored andcommitted
Do not swallow return_value (#44)
* Do not swallow return_value * Add this PR to CHANGELOG
1 parent 9ff8539 commit 4f91e5f

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ unreleased
99
* bugfix: SQLAlcemy plugin would cause warning messages with some db connection strings that contained invalid characters for a segment/subsegment name.
1010
* bugfix: Aiohttp middleware serialized URL values incorrectly. `PR37 <https://github.com/aws/aws-xray-sdk-python/pull/37>`_
1111
* bugfix: Don't overwrite plugins list on each `.configure` call. `PR38 <https://github.com/aws/aws-xray-sdk-python/pull/38>`_
12+
* bugfix: Do not swallow `return_value`. `PR44 <https://github.com/aws/aws-xray-sdk-python/pull/44>`_
1213

1314
0.96
1415
====

aws_xray_sdk/core/recorder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def record_subsegment(self, wrapped, instance, args, kwargs, name,
336336
finally:
337337
# No-op if subsegment is `None` due to `LOG_ERROR`.
338338
if subsegment is None:
339-
return
339+
return return_value
340340

341341
end_time = time.time()
342342
if callable(meta_processor):

tests/ext/botocore/test_botocore.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def test_pass_through_on_context_missing():
122122

123123
with Stubber(ddb) as stubber:
124124
stubber.add_response('describe_table', response, {'TableName': 'mytable'})
125-
ddb.describe_table(TableName='mytable')
125+
result = ddb.describe_table(TableName='mytable')
126+
assert result is not None
126127

127128
xray_recorder.configure(context_missing='RUNTIME_ERROR')

0 commit comments

Comments
 (0)