From f162ae0de0f71391c56957389cc3c8babc8022e1 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Sun, 19 Apr 2015 16:37:00 +0200 Subject: Use with statement --- pyload/cli/Cli.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pyload/cli/Cli.py') diff --git a/pyload/cli/Cli.py b/pyload/cli/Cli.py index 84725b625..a1f192bb3 100644 --- a/pyload/cli/Cli.py +++ b/pyload/cli/Cli.py @@ -321,9 +321,8 @@ class Cli(object): print _("File does not exists.") return - f = open(join(owd, path), "rb") - content = f.read() - f.close() + with open(join(owd, path), "rb") as f: + content = f.read() rid = self.client.checkOnlineStatusContainer([], basename(f.name), content).rid self.printOnlineCheck(self.client, rid) -- cgit v1.2.3