Skip to content

Commit

Permalink
Inline version resolution for User-agent
Browse files Browse the repository at this point in the history
and use a %-format instead of an f-format to maintain compatibility with
Python 3.5 since f-format came in 3.6.
  • Loading branch information
colindean committed Dec 1, 2021
1 parent d30c8ca commit 13ca2ce
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions peru/resources/plugins/curl/curl_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@
import zipfile


def peru_version():
return peru.main.get_version()


def build_request(url):
request = Request(url)
components = [
f"peru/{peru_version()}",
"peru/%s" % peru.main.get_version(),
urllib.request.URLopener.version
]
request.add_header("User-agent", " ".join(components))
Expand Down

0 comments on commit 13ca2ce

Please sign in to comment.