You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by rs...@apache.org on 2020/01/29 08:54:36 UTC
[avro] 17/23: AVRO-2593: Ensure exfile is Always Defined
This is an automated email from the ASF dual-hosted git repository.
rskraba pushed a commit to branch branch-1.9
in repository https://gitbox.apache.org/repos/asf/avro.git
commit 8de8fb33d7a14ba276d360db22144178aeaefa34
Author: Michael A. Smith <mi...@smith-li.com>
AuthorDate: Sat Oct 19 20:34:45 2019 -0400
AVRO-2593: Ensure exfile is Always Defined
Fixes a bug where when a test fails the cleanup code tries to access a variable that might not have been defined when the error occurred.
---
lang/py/test/test_tether_word_count.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lang/py/test/test_tether_word_count.py b/lang/py/test/test_tether_word_count.py
index cc34f2b..d2f1858 100644
--- a/lang/py/test/test_tether_word_count.py
+++ b/lang/py/test/test_tether_word_count.py
@@ -98,6 +98,7 @@ class TestTetherWordCount(unittest.TestCase):
import inspect
proc=None
+ exfile = None
try:
@@ -207,7 +208,7 @@ python -m avro.tether.tether_task_runner word_count_task.WordCountTask
proc.kill()
if os.path.exists(base_dir):
shutil.rmtree(base_dir)
- if os.path.exists(exfile):
+ if exfile is not None and os.path.exists(exfile):
os.remove(exfile)
if __name__== "__main__":