Skip to content

Commit 320dfc8

Browse files
authored
Merge pull request #71 from keshayad/main
Update patch version to v2.0.2
2 parents a94ffb1 + 271cdf6 commit 320dfc8

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

awslambdaric/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
"""
44

5-
__version__ = "2.0.1"
5+
__version__ = "2.0.2"

awslambdaric/bootstrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def __init__(self, fd):
327327
self.frame_type = 0xA55A0001 .to_bytes(4, "big")
328328

329329
def __enter__(self):
330-
self.file = os.fdopen(self.fd, 'wb', 0)
330+
self.file = os.fdopen(self.fd, "wb", 0)
331331
return self
332332

333333
def __exit__(self, exc_type, exc_value, exc_tb):

tests/test_bootstrap.py

+15-5
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,9 @@ def test_log_error_standard_log_sink(self, mock_stdout):
914914

915915
def test_log_error_framed_log_sink(self):
916916
with NamedTemporaryFile() as temp_file:
917-
with bootstrap.FramedTelemetryLogSink(os.open(temp_file.name, os.O_CREAT | os.O_RDWR)) as log_sink:
917+
with bootstrap.FramedTelemetryLogSink(
918+
os.open(temp_file.name, os.O_CREAT | os.O_RDWR)
919+
) as log_sink:
918920
err_to_log = bootstrap.make_error("Error message", "ErrorType", None)
919921
bootstrap.log_error(err_to_log, log_sink)
920922

@@ -949,7 +951,9 @@ def test_log_error_indentation_standard_log_sink(self, mock_stdout):
949951

950952
def test_log_error_indentation_framed_log_sink(self):
951953
with NamedTemporaryFile() as temp_file:
952-
with bootstrap.FramedTelemetryLogSink(os.open(temp_file.name, os.O_CREAT | os.O_RDWR)) as log_sink:
954+
with bootstrap.FramedTelemetryLogSink(
955+
os.open(temp_file.name, os.O_CREAT | os.O_RDWR)
956+
) as log_sink:
953957
err_to_log = bootstrap.make_error(
954958
"Error message", "ErrorType", [" line1 ", " line2 ", " "]
955959
)
@@ -984,7 +988,9 @@ def test_log_error_empty_stacktrace_line_standard_log_sink(self, mock_stdout):
984988

985989
def test_log_error_empty_stacktrace_line_framed_log_sink(self):
986990
with NamedTemporaryFile() as temp_file:
987-
with bootstrap.FramedTelemetryLogSink(os.open(temp_file.name, os.O_CREAT | os.O_RDWR)) as log_sink:
991+
with bootstrap.FramedTelemetryLogSink(
992+
os.open(temp_file.name, os.O_CREAT | os.O_RDWR)
993+
) as log_sink:
988994
err_to_log = bootstrap.make_error(
989995
"Error message", "ErrorType", ["line1", "", "line2"]
990996
)
@@ -1082,7 +1088,9 @@ def test_create_framed_telemetry_log_sinks(self):
10821088
def test_single_frame(self):
10831089
with NamedTemporaryFile() as temp_file:
10841090
message = "hello world\nsomething on a new line!\n"
1085-
with bootstrap.FramedTelemetryLogSink(os.open(temp_file.name, os.O_CREAT | os.O_RDWR)) as ls:
1091+
with bootstrap.FramedTelemetryLogSink(
1092+
os.open(temp_file.name, os.O_CREAT | os.O_RDWR)
1093+
) as ls:
10861094
ls.log(message)
10871095
with open(temp_file.name, "rb") as f:
10881096
content = f.read()
@@ -1101,7 +1109,9 @@ def test_multiple_frame(self):
11011109
first_message = "hello world\nsomething on a new line!"
11021110
second_message = "hello again\nhere's another message\n"
11031111

1104-
with bootstrap.FramedTelemetryLogSink(os.open(temp_file.name, os.O_CREAT | os.O_RDWR)) as ls:
1112+
with bootstrap.FramedTelemetryLogSink(
1113+
os.open(temp_file.name, os.O_CREAT | os.O_RDWR)
1114+
) as ls:
11051115
ls.log(first_message)
11061116
ls.log(second_message)
11071117

0 commit comments

Comments
 (0)