Skip to content

Commit 8c6964d

Browse files
authored
Close file descriptor after using
1 parent 4b5b2da commit 8c6964d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tools/copy_files.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def main():
4141
res = line.strip().split(' ')
4242
ip = res[0]
4343
hosts.append(ip)
44+
45+
f.close()
4446

4547
# We need to update the partition config file so that the paths are relative to
4648
# the workspace in the remote machines.
@@ -67,10 +69,15 @@ def main():
6769
part_files['edge_feats'] = '{}/part{}/edge_feat.dgl'.format(args.rel_data_path, part_id)
6870
part_files['node_feats'] = '{}/part{}/node_feat.dgl'.format(args.rel_data_path, part_id)
6971
part_files['part_graph'] = '{}/part{}/graph.dgl'.format(args.rel_data_path, part_id)
72+
73+
conf_f.close()
74+
7075
tmp_part_config = '/tmp/{}.json'.format(graph_name)
7176
with open(tmp_part_config, 'w') as outfile:
7277
json.dump(tmp_part_metadata, outfile, sort_keys=True, indent=4)
73-
78+
79+
outfile.close()
80+
7481
# Copy ip config.
7582
for part_id, ip in enumerate(hosts):
7683
remote_path = '{}/{}'.format(args.workspace, args.rel_data_path)

0 commit comments

Comments
 (0)