Fix cache shuffling (random.shuffle() shuffles in place, returns None).
authorW. Trevor King <wking@drexel.edu>
Sun, 24 Oct 2010 13:47:53 +0000 (09:47 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 24 Oct 2010 13:48:27 +0000 (09:48 -0400)
pysawsim/sawsim.py

index c0589ef0b1e33f2080bee6f5b10abc83bacbbc2f..0e73940adc6b39368e8061fa17ed601e5479f56b 100644 (file)
@@ -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: