+diff --git a/Lib/_exxo_hack.py b/Lib/_exxo_hack.py
+new file mode 100644
+index 0000000..b8f294a
+--- /dev/null
++++ b/Lib/_exxo_hack.py
+@@ -0,0 +1,63 @@
++import sys
++import os
++import posix
++import stat
++import zipfile
++import errno
++
++
++if zipfile.is_zipfile(sys.executable):
++    exe_zip = zipfile.ZipFile(sys.executable, 'r')
++    exe_names = exe_zip.namelist()
++zip_cache = {}
++
++
++def cached(func):
++    cache = zip_cache.setdefault(func, {})
++    def wrapped(*args):
++        ent = cache.get(args)
++        if ent is None:
++            ent = func(*args)
++            cache[args] = ent
++        return ent
++    return wrapped
++
++
++@cached
++def _get_inzip_path(filename, exc):
++    if not zipfile.is_zipfile(sys.executable):
++        raise exc(errno.ENOENT, filename)
++    inzip_path = filename[len(sys.executable):].lstrip('/')
++    if inzip_path not in exe_names:
++        # try a directory
++        inzip_path = inzip_path + '/'
++        if inzip_path not in exe_names:
++            raise exc(errno.ENOENT, filename)
++    is_dir = inzip_path.endswith('/')
++    return inzip_path, is_dir
++
++
++def get_file(filename):
++    inzip_path, _ = _get_inzip_path(filename, IOError)
++    return exe_zip.open(inzip_path)
++
++
++@cached
++def stat_file(filename):
++    inzip_path, is_dir = _get_inzip_path(filename, OSError)
++    info = exe_zip.getinfo(inzip_path)
++    stat_result = list(os.stat(sys.executable))
++    stat_result[6] = info.file_size
++    if is_dir:
++        stat_result[0] &= ~(stat.S_IFREG | stat.S_IFLNK)
++        stat_result[0] |= stat.S_IFDIR
++    return posix.stat_result(stat_result)
++
++
++@cached
++def listdir(directory):
++    fixed_directory = directory.rstrip('/') + '/'
++    inzip_path, is_dir = _get_inzip_path(fixed_directory, OSError)
++    if not is_dir:
++        raise OSError(errno.ENOTDIR, directory)
++    return [n[len(inzip_path):] for n in exe_names if n != inzip_path and n.startswith(inzip_path)]
+diff --git a/Lib/imp.py b/Lib/imp.py
+index c922e92..3d9d4f8 100644
+--- a/Lib/imp.py
++++ b/Lib/imp.py
+@@ -26,6 +26,7 @@ import sys
+ import tokenize
+ import types
+ import warnings
++from zipimport import zipimporter
+ 
+ warnings.warn("the imp module is deprecated in favour of importlib; "
+               "see the module's documentation for alternative uses",
+@@ -279,6 +280,18 @@ def find_module(name, path=None):
+             path = sys.path
+ 
+     for entry in path:
++        for meta in sys.path_hooks:
++            if meta is not zipimporter:
++                continue
++            try:
++                loader = meta(entry)
++            except ImportError:
++                continue
++            print (loader, name, entry, loader.find_module(name))
++            if loader.find_module(name) is None:
++                continue
++            newpath = os.path.join(entry, name)
++            return None, newpath, ()
+         package_directory = os.path.join(entry, name)
+         for suffix in ['.py', machinery.BYTECODE_SUFFIXES[0]]:
+             package_file_name = '__init__' + suffix
+diff --git a/Lib/inspect.py b/Lib/inspect.py
+index 4298de6..9b9e34d 100644
+--- a/Lib/inspect.py
++++ b/Lib/inspect.py
+@@ -585,6 +585,9 @@ def getsourcefile(object):
+     # or it is in the linecache
+     if filename in linecache.cache:
+         return filename
++    # a workaround for packages like django debug toolbar
++    if filename.startswith('<pyrun>'):
++        return filename
+ 
+ def getabsfile(object, _filename=None):
+     """Return an absolute path to the source or compiled file for an object.
 diff --git a/Makefile.pre.in b/Makefile.pre.in
 index e19fc00..4d372e9 100644
 --- a/Makefile.pre.in

     path = make_filename(self->prefix, subname);
     Py_DECREF(subname);
     if (path == NULL)
@@ -1400,7 +1600,6 @@ get_module_code(ZipImporter *self, PyObject *fullname,
                                self->archive, (int)SEP, fullpath);
         toc_entry = PyDict_GetItem(self->files, fullpath);
         if (toc_entry != NULL) {

             code = get_code_from_data(self, ispackage,
                                       isbytecode, mtime,
                                       toc_entry);
@@ -1422,10 +1633,8 @@ get_module_code(ZipImporter *self, PyObject *fullname,
                 Py_DECREF(code);
                 continue;
             }
