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 <[email protected]> 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__":
