diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-05-04 14:25:31 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.lima@openbossa.org> | 2012-05-04 19:28:16 +0200 |
commit | a090ae9340b6ef8b135919c69ca377f763e138ad (patch) | |
tree | 9c346d5acdef34fcb322680ae63dddfa6815402d | |
parent | a9141c494501f627ee111fa717e1a356cfe1fc8b (diff) |
Do not always try to remove bytecode version of the test.
Trying to remove the bytecode file doesn't work if it wasn't created
in the first place. This can happen for example under Gentoo, where
bytecode is disabled while building packages to avoid sandbox
violations when Python tries to write a bytecode file for an
already-installed module outside the package build directory.
Change-Id: I4cbd63527479365e6f201d3fc51c576f55830680
Reviewed-by: Hugo Parente Lima <hugo.lima@openbossa.org>
-rw-r--r-- | tests/QtCore/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tests/QtGui/pyside_reload_test.py | 14 |
2 files changed, 8 insertions, 7 deletions
diff --git a/tests/QtCore/CMakeLists.txt b/tests/QtCore/CMakeLists.txt index 9e49b76d4..a8609de50 100644 --- a/tests/QtCore/CMakeLists.txt +++ b/tests/QtCore/CMakeLists.txt @@ -27,6 +27,7 @@ PYSIDE_TEST(bug_1019.py) PYSIDE_TEST(bug_1031.py) PYSIDE_TEST(bug_1063.py) PYSIDE_TEST(bug_1069.py) +PYSIDE_TEST(bug_PYSIDE-42.py) PYSIDE_TEST(blocking_signals_test.py) PYSIDE_TEST(classinfo_test.py) PYSIDE_TEST(child_event_test.py) diff --git a/tests/QtGui/pyside_reload_test.py b/tests/QtGui/pyside_reload_test.py index 3fd593c63..10695084c 100644 --- a/tests/QtGui/pyside_reload_test.py +++ b/tests/QtGui/pyside_reload_test.py @@ -23,13 +23,13 @@ def increment_module_value(): modfile.write('Sentinel.value += 1' + os.linesep) modfile.flush() modfile.close() - if py3k.IS_PY3K: - import imp - cacheFile = imp.cache_from_source(dst) - else: - cacheFile = dst + 'c' - - os.remove(cacheFile) + if not sys.dont_write_bytecode: + if py3k.IS_PY3K: + import imp + cacheFile = imp.cache_from_source(dst) + else: + cacheFile = dst + 'c' + os.remove(cacheFile) class TestModuleReloading(unittest.TestCase): |