Erik Bray committed 10d4b7b

Adds some missing bits to the sandbox fix--need to actually save/restore the pkg_resources state.

Comments (0)

Files changed (2)

     def __setstate__(self, (entries, keys, by_key, callbacks)):
         self.entries = entries[:]
+        self.entry_keys = keys.copy()
         self.by_key = by_key.copy()
         self.callbacks = callbacks[:]


-import os, sys, __builtin__, tempfile, operator
+import os, sys, __builtin__, tempfile, operator, pkg_resources
 _os = sys.modules[]
     _file = file
     if not os.path.isdir(temp_dir): os.makedirs(temp_dir)
     save_tmp = tempfile.tempdir
     save_modules = sys.modules.copy()
+    pr_state = pkg_resources.__getstate__()
         tempfile.tempdir = temp_dir
             # Normal exit, just return
+        pkg_resources.__setstate__(pr_state)
         for key in list(sys.modules):
             if key not in save_modules: del sys.modules[key]
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.