Diff of /pyke/target_pkg.py [9ac085] .. [0176eb] Maximize Restore

  Switch to side-by-side view

--- a/pyke/target_pkg.py
+++ b/pyke/target_pkg.py
@@ -30,6 +30,7 @@
 import os, os.path
 import time
 import sys
+import imp
 import re
 import pyke
 
@@ -300,7 +301,7 @@
             module = sys.modules[module_path]
             if filename in self.compiled_targets:
                 if debug: print >> sys.stderr, "load_module: reloading"
-                module = reload(module)
+                module = imp.reload(module)
         elif do_import:
             if debug: print >> sys.stderr, "load_module: importing"
             module = import_(module_path)
@@ -322,10 +323,9 @@
         full_path = os.path.join(self.directory, filename)
         if self.loader:
             import contextlib
-            import StringIO
+            import io
             ctx_lib = \
-                contextlib.closing(
-                    StringIO.StringIO(self.loader.get_data(full_path)))
+                contextlib.closing(io.BytesIO(self.loader.get_data(full_path)))
         else:
             ctx_lib = open(full_path, 'rb')
         with ctx_lib as f: