File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -116,9 +116,14 @@ def parse_file(self, path):
116116 self .jsre_parser .predict (self .jsre_model ,
117117 jsre_fn , jsre_fn + '_out' )
118118
119+ # Remove jSRE input file
120+ os .remove (jsre_fn )
119121 rel = []
120122 # Read results from jSRE output files
121- with io .open (jsre_fn + '_out' , 'r' ) as inf :
123+ jsre_output_file = jsre_fn + '_out'
124+ if not os .path .exists (jsre_output_file ):
125+ continue
126+ with io .open (jsre_output_file , 'r' ) as inf :
122127 lines = inf .readlines ()
123128 n_cand = len (lines )
124129 for (l ,ex ) in zip (lines , relations ):
@@ -159,8 +164,7 @@ def parse_file(self, path):
159164 n_cand ))
160165 total_rel += rel
161166
162- # Remove tmp files
163- os .remove (jsre_fn )
167+ # Remove tmp output file
164168 os .remove (jsre_fn + '_out' )
165169
166170 if total_rel :
You can’t perform that action at this time.
0 commit comments