From c846bab69b06134cc42862557aef59367296d47e Mon Sep 17 00:00:00 2001 From: Marius Gedminas Date: Thu, 27 Aug 2015 22:09:42 +0300 Subject: [PATCH] Fix assert statement syntax `assert (condition, message)` gets parsed by Python as `assert a_two_tuple`, and a 2-element tuple is never False. Discovered by compileall on Python 3.4, which emits a SyntaxWarning for this common mistake. --- test/integration/cleanup_rax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 test/integration/cleanup_rax.py diff --git a/test/integration/cleanup_rax.py b/test/integration/cleanup_rax.py old mode 100644 new mode 100755 index f872e9458db..5c757f53c54 --- a/test/integration/cleanup_rax.py +++ b/test/integration/cleanup_rax.py @@ -54,8 +54,8 @@ def authenticate(): def prompt_and_delete(item, prompt, assumeyes): if not assumeyes: assumeyes = raw_input(prompt).lower() == 'y' - assert (hasattr(item, 'delete') or hasattr(item, 'terminate'), - "Class <%s> has no delete or terminate attribute" % item.__class__) + assert hasattr(item, 'delete') or hasattr(item, 'terminate'), \ + "Class <%s> has no delete or terminate attribute" % item.__class__ if assumeyes: if hasattr(item, 'delete'): item.delete()