From 1ce40e76ad9af7962783cf11e0622d94356cf078 Mon Sep 17 00:00:00 2001 From: Christian Herdtweck Date: Wed, 22 Jun 2016 18:16:35 +0200 Subject: [PATCH] close fileobj only if it exists --- testing/__init__.py | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/testing/__init__.py b/testing/__init__.py index c538fef..42ccef7 100644 --- a/testing/__init__.py +++ b/testing/__init__.py @@ -30,7 +30,8 @@ def closing_new_volume_handler(tarobj, base_name, volume_number): Handles the new volumes ''' volume_path = "%s.%d" % (base_name, volume_number) - tarobj.fileobj.close() + if tarobj.fileobj: + tarobj.fileobj.close() tarobj.open_volume(volume_path) class BaseTest(unittest.TestCase): -- 1.7.1