Skip to content

Commit

Permalink
fix: fstring formatted with bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
tvytlx committed Feb 21, 2019
1 parent 9038704 commit f23ccbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions requests_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,9 +416,9 @@ def __init__(self, *, session: Union['HTMLSession', 'AsyncHTMLSession'] = None,
if isinstance(html, str):
html = html.encode(DEFAULT_ENCODING)

pq = PyQuery(html)
super(HTML, self).__init__(
# Convert unicode HTML to bytes.
element=PyQuery(html)('html') or PyQuery(f'<html>{html}</html>')('html'),
element=pq('html') or pq.wrapAll('<html></html>')('html'),
html=html,
url=url,
default_encoding=default_encoding
Expand Down

0 comments on commit f23ccbf

Please sign in to comment.