Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.

Commit a044072

Browse files
committed
Update ip example using context manager
1 parent 5cb838b commit a044072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/ip.hy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(import hyper json)
22

33
(defn http2bin [path]
4-
(let [[conn (hyper.HTTPConnection "http2bin.org")]]
4+
(with [[conn (hyper.HTTPConnection "http2bin.org")]]
55
(.request conn "GET" path)
66
(-> (.get_response conn) (.read) (json.loads))))
77

0 commit comments

Comments
 (0)