From: W. Trevor King Date: Sun, 24 Oct 2010 13:47:53 +0000 (-0400) Subject: Fix cache shuffling (random.shuffle() shuffles in place, returns None). X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3ab517e4b3a5a15659ff8c38f37e1cd504b46e05;p=sawsim.git Fix cache shuffling (random.shuffle() shuffles in place, returns None). --- 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: