Skip to content

Commit ce78dc7

Browse files
More f-strings
Co-authored-by: Savannah Ostrowski <savannah@python.org>
1 parent 7601b46 commit ce78dc7

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

add_to_pydotorg.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ def list_files(
298298

299299
def query_object(base_url: str, objtype: str, **params: Any) -> int:
300300
"""Find an API object by query parameters."""
301-
uri = base_url + f"downloads/{objtype}/"
301+
uri = f"{base_url}downloads/{objtype}/"
302302
uri += "?" + "&".join(f"{k}={v}" for k, v in params.items())
303303
resp = session.get(uri)
304304
if resp.status_code != 200 or not json.loads(resp.text)["objects"]:
@@ -309,10 +309,7 @@ def query_object(base_url: str, objtype: str, **params: Any) -> int:
309309

310310
def post_object(base_url: str, objtype: str, datadict: dict[str, Any]) -> int:
311311
"""Create a new API object."""
312-
resp = session.post(
313-
base_url + "downloads/" + objtype + "/",
314-
data=json.dumps(datadict),
315-
)
312+
resp = session.post(f"{base_url}downloads/{objtype}/", data=json.dumps(datadict))
316313
if resp.status_code != 201:
317314
try:
318315
info = json.loads(resp.text)

0 commit comments

Comments
 (0)