From fd94f6e80673cb523bbfd3255990c32c741b8f14 Mon Sep 17 00:00:00 2001 From: Will Boyd Date: Wed, 23 Mar 2016 11:35:25 -0400 Subject: [PATCH] Fixed Python 3 bug in both run_tests.py and distribcell_paths setter in summary.py --- openmc/summary.py | 5 +++-- tests/run_tests.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/openmc/summary.py b/openmc/summary.py index f17c0c8f9..9609a866b 100644 --- a/openmc/summary.py +++ b/openmc/summary.py @@ -564,8 +564,9 @@ class Summary(object): # Read in distribcell paths if filter_type == 'distribcell': - new_filter.distribcell_paths = \ - self._f['{0}/paths'.format(subsubbase)][...] + paths = self._f['{0}/paths'.format(subsubbase)][...] + paths = [path.decode() for path in paths] + new_filter.distribcell_paths = paths # Add Filter to the Tally tally.filters.append(new_filter) diff --git a/tests/run_tests.py b/tests/run_tests.py index 48fc23d4a..ed6ff0c20 100755 --- a/tests/run_tests.py +++ b/tests/run_tests.py @@ -363,10 +363,14 @@ sourcepoint_batch|statepoint_interval|survival_biasing|\ tally_assumesep|translation|uniform_fs|universe|void" # Delete items of dictionary if valgrind or coverage and not in script mode +to_delete = [] if not script_mode: for key in tests: if re.search('valgrind|coverage', key): - del tests[key] + to_delete.append(key) + +for key in to_delete: + del tests[key] # Check if tests empty if len(list(tests.keys())) == 0: