From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SK9Bm-0000OM-W1 for garchives@archives.gentoo.org; Tue, 17 Apr 2012 14:15:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E503CE068E; Tue, 17 Apr 2012 14:15:04 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B3917E068E for ; Tue, 17 Apr 2012 14:15:04 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B50C81B400A for ; Tue, 17 Apr 2012 14:15:03 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 786DCE5403 for ; Tue, 17 Apr 2012 14:15:02 +0000 (UTC) From: "Vikraman Choudhury" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Vikraman Choudhury" Message-ID: <1334671573.57d76a1e76d77b23ed3e616dae761bc8e6b7021c.vikraman@gentoo> Subject: [gentoo-commits] proj/gentoostats:master commit in: client/gentoostats/, client/ X-VCS-Repository: proj/gentoostats X-VCS-Files: client/gentoostats-send client/gentoostats/utils.py X-VCS-Directories: client/gentoostats/ client/ X-VCS-Committer: vikraman X-VCS-Committer-Name: Vikraman Choudhury X-VCS-Revision: 57d76a1e76d77b23ed3e616dae761bc8e6b7021c X-VCS-Branch: master Date: Tue, 17 Apr 2012 14:15:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 1646afb0-0d05-4ad0-8302-689227dcec47 X-Archives-Hash: 5c5668ed9b744ce2fb6038f140d3c76a commit: 57d76a1e76d77b23ed3e616dae761bc8e6b7021c Author: Vikraman Choudhury gmail com> AuthorDate: Tue Apr 17 14:06:13 2012 +0000 Commit: Vikraman Choudhury gmail com> CommitDate: Tue Apr 17 14:06:13 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/gentoostats.g= it;a=3Dcommit;h=3D57d76a1e 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() =20 if __name__ =3D=3D "__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=3DTrue): data =3D conn.getresponse().read() except httplib.HTTPException: return None + finally: + if conn: + conn.close() return data =20 def deserialize(object):