Correct virtuel_env creation. Problem with tmpdir in extra_env, end extra_env null
authorymh <ymh.work@gmail.com>
Wed, 09 Jan 2013 10:37:24 +0100
changeset 53 74ec1c2f245c
parent 52 509085ffbce6
child 54 89e5ee57bd89
Correct virtuel_env creation. Problem with tmpdir in extra_env, end extra_env null
virtualenv/res/lib/lib_create_env.py
--- a/virtualenv/res/lib/lib_create_env.py	Tue Jan 08 18:10:38 2013 +0100
+++ b/virtualenv/res/lib/lib_create_env.py	Wed Jan 09 10:37:24 2013 +0100
@@ -302,9 +302,9 @@
         ignore_packages = []
         
         if system_str == 'Windows':
-            default_install_options = {'method': 'easy_install', 'option_str': None, 'dict_extra_env': None}
+            default_install_options = {'method': 'easy_install', 'option_str': None, 'dict_extra_env': {}}
         else:
-            default_install_options = {'method': 'pip', 'option_str': None, 'dict_extra_env': None}
+            default_install_options = {'method': 'pip', 'option_str': None, 'dict_extra_env': {}}
             
         if options.ignore_packages :
             ignore_packages = options.ignore_packages.split(",")
@@ -320,6 +320,9 @@
                 method = install_options.get('method', default_install_options['method'])
                 option_str = install_options.get('option_str', default_install_options['option_str'])
                 extra_env = install_options.get('dict_extra_env', default_install_options['dict_extra_env'])
+                if not extra_env:
+                    extra_env = {}
+                    
                 if 'TMPDIR' not in extra_env:
                     extra_env['TMPDIR'] = os.path.abspath(tmp_dir)          
                 #isinstance(lst, (list, tuple))