Skip to content

Commit 1825943

Browse files
committed
use format
1 parent cf6f497 commit 1825943

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

extruct/_extruct.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def extract(htmlstring,
6161
return {}
6262
if errors == 'log':
6363
logger.exception(
64-
f'Failed to parse html, raises {e}')
64+
'Failed to parse html, raises {}'.format(e))
6565
return {}
6666
if errors == 'strict':
6767
raise e
@@ -101,7 +101,9 @@ def extract(htmlstring,
101101
output[syntax] = list(extract(document, base_url=base_url))
102102
except Exception as e:
103103
if errors == 'log':
104-
logger.exception(f'Failed to extract {syntax}, raises {e}')
104+
logger.exception('Failed to extract {}, raises {}'
105+
.format(syntax, e)
106+
)
105107
if errors == 'ignore':
106108
pass
107109
if errors == 'strict':
@@ -141,7 +143,9 @@ def extract(htmlstring,
141143
if errors == 'log':
142144
output[syntax] = []
143145
logger.exception(
144-
f'Failed to uniform extracted for {syntax}, raises {e}')
146+
'Failed to uniform extracted for {}, raises {}'
147+
.format(syntax, e)
148+
)
145149
if errors == 'strict':
146150
raise
147151

0 commit comments

Comments
 (0)