~fluendo-elisa/moovida/elisa-pancake

« back to all changes in this revision

Viewing changes to elisa-plugins/elisa/plugins/amp/master.py

  • Committer: pancake
  • Date: 2009-03-27 12:16:38 UTC
  • mfrom: (1115.2.37 elisa)
  • Revision ID: pancake@flubox-20090327121638-2da0c1a0zu3byufd
* Merge against the head

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
        
178
178
        slave.process_protocol = self.slaveProcessProtocolFactory(self,
179
179
                slave.cookie)
180
 
        env = dict(os.environ)
 
180
 
 
181
        if platform.system() == 'Windows':
 
182
            # FIXME: reuse only the environment that are accessible
 
183
            # (eg, the ones not containing lower-case accentuated
 
184
            # characters). This is done to workaround modifications
 
185
            # done to os.environ by one of elisa's runtime
 
186
            # dependencies. This hack could not be put in the elisa
 
187
            # launcher because the dark-magic modifications of
 
188
            # os.environ happen after the launcher has started
 
189
            # elisa. Needs further investigation...
 
190
            env = {}
 
191
            for key in os.environ.keys():
 
192
                try:
 
193
                    value = os.environ[key]
 
194
                except KeyError:
 
195
                    continue
 
196
                env[key] = value
 
197
 
 
198
            # override os.environ because it's accessed from
 
199
            # twisted.internet._dumbwin32proc
 
200
            os.environ = os._Environ(env)
 
201
        else:
 
202
            env = dict(os.environ)
 
203
 
181
204
        path = os.path.dirname(sys.modules['elisa'].__path__[0])
182
205
        env['PYTHONPATH'] = os.pathsep.join([path] + sys.path)
183
206
        # *boom*