From 3ab517e4b3a5a15659ff8c38f37e1cd504b46e05 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 24 Oct 2010 09:47:53 -0400 Subject: [PATCH] Fix cache shuffling (random.shuffle() shuffles in place, returns None). --- pysawsim/sawsim.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pysawsim/sawsim.py b/pysawsim/sawsim.py index c0589ef..0e73940 100644 --- a/pysawsim/sawsim.py +++ b/pysawsim/sawsim.py @@ -208,7 +208,9 @@ class SawsimRunner (object): def _load_cached_data(self, param_string): pcd = self._param_cache_dir(param_string) - for filename in shuffle(os.listdir(pcd)): + filenames = os.listdir(pcd) + shuffle(filenames) + for filename in filenames: if not filename.endswith('.dat'): continue with open(os.path.join(pcd, filename), 'r') as f: -- 2.26.2