summaryrefslogtreecommitdiffstats
path: root/pyload/cli/Cli.py
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-19 16:37:00 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-04-19 16:37:00 +0200
commitf162ae0de0f71391c56957389cc3c8babc8022e1 (patch)
treec85c8117da6e20fe49f91c933d8c7e57eb808cb8 /pyload/cli/Cli.py
parentMerge pull request #8 from ardi69/0.4.10 (diff)
downloadpyload-f162ae0de0f71391c56957389cc3c8babc8022e1.tar.xz
Use with statement
Diffstat (limited to 'pyload/cli/Cli.py')
-rw-r--r--pyload/cli/Cli.py5
1 files changed, 2 insertions, 3 deletions
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)