opened
lpfann
username_0
fixed dict update method for python 3 compatibility
issue
created
matteoferla
username_1
Here is a snippet that applies during runtime the above fix (before running the `GridEngineScheduler`) without altering files and stuff.
I thought I had pip-installed this module from pypi  but in writing this comment here I realised it was pip-installed from git, so I should have simply installed the fork whence the merge request came... Oh well.

```
def monkeypatch():
    # patch as in https://github.com/hbristow/gridengine/pull/2
    import inspect, gridengine
    from gridengine import job, settings
    old = 'resources = dict(self.resources.items() + resources.items())'
    new = 'resources = resources.update(self.resources) if resources else self.resources'
    old_code = inspect.getsource(gridengine.GridEngineScheduler.schedule)
    new_code = old_code.replace(old, new)
    exec('class Dummy(gridengine.GridEngineScheduler):\n'+new_code, globals())
    gridengine.GridEngineScheduler = Dummy
    gridengine.schedulers.GridEngineScheduler = Dummy
monkeypatch()
```
comment