From: Michal 'vorner' Vaner Date: Thu, 15 Aug 2013 06:43:26 +0000 (+0200) Subject: Don't fail with nonexistent files X-Git-Tag: bind10-1.2.0beta1-release~274 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f80c824d8b1745a0cedbbb238b0e988f7acb10ee;p=thirdparty%2Fkea.git Don't fail with nonexistent files When the script does not exist, because it was not generated due to some configure switch or environmental condition, don't try to check if it gets renamed. That would fail even when the situation is completely OK and expected. --- diff --git a/src/bin/tests/process_rename_test.py.in b/src/bin/tests/process_rename_test.py.in index ea8ad87cee..7e6a9c9ab0 100644 --- a/src/bin/tests/process_rename_test.py.in +++ b/src/bin/tests/process_rename_test.py.in @@ -25,6 +25,11 @@ class TestRename(unittest.TestCase): def __scan(self, directory, script, fun): # Scan one script if it contains call to the renaming function filename = os.path.join(directory, script) + if not os.path.exists(filename): + # We either didn't compile it yet or it is not compiled based + # on some environmental condition. That is OK, we don't want + # to break on that. + return with open(filename) as f: data = ''.join(f.readlines()) prettyname = 'src' + filename[filename.rfind('../') + 2:]