Skip to content
Browse files

Error checking added to flush and close

  • Loading branch information...
1 parent 0b64db9 commit fe9a138341cf6424725ccae7a4ab502f99a1a83a @cmclean cmclean committed Jun 27, 2012
Showing with 8 additions and 2 deletions.
  1. +8 −2 vcf/parser.py
View
10 vcf/parser.py
@@ -1067,11 +1067,17 @@ def write_record(self, record):
def flush(self):
"""Flush the writer"""
- self.stream.flush()
+ try:
+ self.stream.flush()
+ except AttributeError:
+ pass
def close(self):
"""Close the writer"""
- self.stream.close()
+ try:
+ self.stream.close()
+ except AttributeError:
+ pass
def _fix_field_count(self, num_str):
"""Restore header number to original state"""

0 comments on commit fe9a138

Please sign in to comment.
Something went wrong with that request. Please try again.