Skip to content

Commit d84c2f4

Browse files
author
Shakeel Mohamed
committed
Testing tarfile with closing…
1 parent f4f6047 commit d84c2f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from distutils.core import setup, Command
1818
import os, shutil, tarfile
1919
import splunklib
20+
from contextlib import closing
2021

2122
def run_test_suite():
2223
try:
@@ -94,7 +95,7 @@ def run(self):
9495
modinput_dir = os.path.join(splunklib_dir, "modularinput")
9596

9697
for app in app_names:
97-
with tarfile.open(os.path.join("build", app + ".spl"), "w") as spl:
98+
with closing(tarfile.open(os.path.join("build", app + ".spl"), "w")) as spl:
9899
spl.add(
99100
os.path.join("examples", app, app + ".py"),
100101
arcname=os.path.join(app, "bin", app + ".py")

0 commit comments

Comments
 (0)