mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix integration.modules.git.GitModuleTest.test_archive on py26
Fix borrowed from: http://stackoverflow.com/questions/6086603/statement-with-and-tarfile
This commit is contained in:
parent
e57f767244
commit
dbbe206e19
@ -2,6 +2,7 @@
|
||||
|
||||
# Import Python Libs
|
||||
from __future__ import absolute_import
|
||||
from contextlib import closing
|
||||
import errno
|
||||
import logging
|
||||
import os
|
||||
@ -155,7 +156,7 @@ class GitModuleTest(integration.ModuleCase):
|
||||
)
|
||||
)
|
||||
self.assertTrue(tarfile.is_tarfile(tar_archive))
|
||||
with tarfile.open(tar_archive, 'r') as tar_obj:
|
||||
with closing(tarfile.open(tar_archive, 'r')) as tar_obj:
|
||||
self.assertEqual(
|
||||
tar_obj.getnames(),
|
||||
['foo', 'foo/bar', 'foo/baz', 'foo/foo', 'foo/qux',
|
||||
|
Loading…
Reference in New Issue
Block a user