From 604eb3066241bfacc94d042072598daa25392662 Mon Sep 17 00:00:00 2001
From: Jean-Paul Calderone <exarkun@twistedmatrix.com>
Date: Sat, 19 Feb 2022 10:52:20 -0500
Subject: [PATCH] pull uri construction out to ease reuse

---
 src/_zkapauthorizer/tahoe.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/_zkapauthorizer/tahoe.py b/src/_zkapauthorizer/tahoe.py
index d8f4875..60d696e 100644
--- a/src/_zkapauthorizer/tahoe.py
+++ b/src/_zkapauthorizer/tahoe.py
@@ -88,8 +88,9 @@ async def upload(
     :raise: If there is a problem uploading the data -- except for
         unavailability of storage servers -- then some exception is raised.
     """
+    uri = api_root.child("uri")
     with inpath.open() as f:
-        resp = await client.put(api_root.child("uri"), f)
+        resp = await client.put(uri, f)
     content = (await treq.content(resp)).decode("utf-8")
     if resp.code in (200, 201):
         return content
-- 
GitLab