diff --git a/yabt/dot.py b/yabt/dot.py
index <HASH>..<HASH> 100644
--- a/yabt/dot.py
+++ b/yabt/dot.py
@@ -81,11 +81,10 @@ def dot_file_line_proc(nx_g, line):
 
 def load_dot(in_fname):
     """ Read graph from dot format """
-    in_f = open(in_fname, 'r')
-    nx_g = networkx.DiGraph()
-    for line in in_f:
-        dot_file_line_proc(nx_g, line)
-    in_f.close()
+    with open(in_fname, 'r') as in_f:
+        nx_g = networkx.DiGraph()
+        for line in in_f:
+            dot_file_line_proc(nx_g, line)
     return nx_g
Using with open(..)