File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ def main(argv=None):
2929 )
3030 io_group .add_argument (
3131 "--log" ,
32- type = argparse .FileType ("w" ),
3332 help = "Log file of primers and location (default: not written)" ,
3433 )
3534 io_group .add_argument (
@@ -140,8 +139,10 @@ def main(argv=None):
140139 output_reads = trimmable_reads .output_reads (args .min_length )
141140 write_fastq (output_fastq , output_reads )
142141
143- output_loginfo = trimmable_reads .output_loginfo ()
144- write_log (args .log , output_loginfo , trimmable_reads .loginfo_colnames )
142+ if args .log :
143+ output_loginfo = trimmable_reads .output_loginfo ()
144+ with open (args .log , "w" ) as f :
145+ write_log (f , output_loginfo , trimmable_reads .loginfo_colnames )
145146
146147
147148def write_fastq (f , reads ):
You can’t perform that action at this time.
0 commit comments