Skip to content
Snippets Groups Projects
Commit d086e595 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

Try a fix for issue 24

parent b6678cdc
No related branches found
No related tags found
1 merge request!27Try a fix for issue 24
Pipeline #
...@@ -30,12 +30,17 @@ import sys ...@@ -30,12 +30,17 @@ import sys
sys.path[0:0] = [ sys.path[0:0] = [
%%(path)s, %%(path)s,
] ]
if sys.version_info[:2] >= (3, 6): #see: http://bugs.python.org/issue30167
#see: http://bugs.python.org/issue30167
if sys.version_info[:2] >= (3, 6) and \
sys.modules['__main__'].__loader__ is not None:
_hack = str(sys.modules['__main__'].__loader__.__module__) _hack = str(sys.modules['__main__'].__loader__.__module__)
sys.modules['__main__'].__loader__.__module__ += '_' sys.modules['__main__'].__loader__.__module__ += '_'
import site #initializes site properly import site #initializes site properly
site.main() #this is required for python>=3.4 site.main() #this is required for python>=3.4
if sys.version_info[:2] >= (3, 6): #restore original value just in case... if sys.version_info[:2] >= (3, 6) and \
sys.modules['__main__'].__loader__ is not None:
#restores original value
sys.modules['__main__'].__loader__.__module__ = _hack sys.modules['__main__'].__loader__.__module__ = _hack
import pkg_resources #initializes virtualenvs properly import pkg_resources #initializes virtualenvs properly
%%(initialization)s %%(initialization)s
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment