/breezy-debian/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy-debian/unstable

« back to all changes in this revision

Viewing changes to launchpad.py

  • Committer: Jelmer Vernooij
  • Date: 2018-10-15 07:45:11 UTC
  • Revision ID: jelmer@jelmer.uk-20181015074511-0kwd639wr7y4w5ot
Use context managers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        if not os.path.exists(creds_path):
49
49
            return None
50
50
        creds = Credentials("bzr-builddeb")
51
 
        f = open(creds_path)
52
 
        try:
 
51
        with open(creds_path) as f:
53
52
            creds.load(f)
54
 
        finally:
55
 
            f.close()
56
53
        return Launchpad(creds, service_root=LPNET_SERVICE_ROOT)
57
54
 
58
55