summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xjt5
1 files changed, 2 insertions, 3 deletions
diff --git a/jt b/jt
index 4dcd6d6..5390883 100755
--- a/jt
+++ b/jt
@@ -80,9 +80,8 @@ class NewCommand(Command):
'title': title,
'date': time.strftime('%Y-%m-%d %H:%M')
}
- f = open(name, 'w')
- f.write(template % values)
- f.close()
+ with open(name, 'w') as f:
+ f.write(template % values)
class ListCommand(Command):