Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 2406a0d

Browse files
committed
Merge branch 'mypy' of github.com:bringhurst/python-json-logger into mypy
2 parents 8abb283 + f8dd310 commit 2406a0d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/pythonjsonlogger/jsonlogger.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,11 @@ def parse(self) -> List[str]:
157157
formatter_style_pattern = re.compile(r'%\((.+?)\)s', re.IGNORECASE)
158158
else:
159159
raise ValueError('Invalid format: %s' % self._fmt)
160-
return formatter_style_pattern.findall(self._fmt)
160+
161+
if self._fmt:
162+
return formatter_style_pattern.findall(self._fmt)
163+
else:
164+
return []
161165

162166
def add_fields(self, log_record, record, message_dict):
163167
"""

0 commit comments

Comments
 (0)