public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Vikraman Choudhury" <vikraman.choudhury@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/gentoostats:master commit in: client/gentoostats/, client/
Date: Tue, 17 Apr 2012 14:15:02 +0000 (UTC)	[thread overview]
Message-ID: <1334671573.57d76a1e76d77b23ed3e616dae761bc8e6b7021c.vikraman@gentoo> (raw)

commit:     57d76a1e76d77b23ed3e616dae761bc8e6b7021c
Author:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
AuthorDate: Tue Apr 17 14:06:13 2012 +0000
Commit:     Vikraman Choudhury <vikraman.choudhury <AT> gmail <DOT> com>
CommitDate: Tue Apr 17 14:06:13 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/gentoostats.git;a=commit;h=57d76a1e

close HTTPConnection in finally block

---
 client/gentoostats-send     |    3 +++
 client/gentoostats/utils.py |    3 +++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/client/gentoostats-send b/client/gentoostats-send
index 324b2bc..2ae2857 100755
--- a/client/gentoostats-send
+++ b/client/gentoostats-send
@@ -72,6 +72,9 @@ def main():
     except httplib.HTTPException:
         sys.stderr.write('Something went wrong')
         sys.exit(1)
+    finally:
+        if conn:
+            conn.close()
 
 if __name__ == "__main__":
     main()

diff --git a/client/gentoostats/utils.py b/client/gentoostats/utils.py
index 43a3c73..af807c8 100644
--- a/client/gentoostats/utils.py
+++ b/client/gentoostats/utils.py
@@ -18,6 +18,9 @@ def GET(server, url, headers, https=True):
         data = conn.getresponse().read()
     except httplib.HTTPException:
         return None
+    finally:
+        if conn:
+            conn.close()
     return data
 
 def deserialize(object):



             reply	other threads:[~2012-04-17 14:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 14:15 Vikraman Choudhury [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-08-21 23:15 [gentoo-commits] proj/gentoostats:master commit in: client/gentoostats/, client/ Vikraman Choudhury
2011-08-01 23:04 Vikraman Choudhury
2011-08-01 22:24 Vikraman Choudhury
2011-08-01 22:24 Vikraman Choudhury
2011-07-25 12:35 Vikraman Choudhury
2011-06-23 15:14 Vikraman Choudhury

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1334671573.57d76a1e76d77b23ed3e616dae761bc8e6b7021c.vikraman@gentoo \
    --to=vikraman.choudhury@gmail.com \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox