diff --git a/odoo.py b/odoo.py index 30d6983ff5a4d..e95814036a80d 100755 --- a/odoo.py +++ b/odoo.py @@ -153,6 +153,12 @@ def main(): elif len(sys.argv) == 2 and sys.argv[1] in cmds: cmds[sys.argv[1]]() else: + if sys.argv[1] == 'gevent': + sys.argv.remove('gevent') + import gevent.monkey + gevent.monkey.patch_all() + import psycogreen.gevent + psycogreen.gevent.patch_psycopg() import odoo odoo.cli.main() diff --git a/odoo/service/server.py b/odoo/service/server.py index 6d6c585212d95..3d181396a6ffc 100644 --- a/odoo/service/server.py +++ b/odoo/service/server.py @@ -443,9 +443,8 @@ def worker_spawn(self, klass, workers_registry): def long_polling_spawn(self): nargs = stripped_sys_argv() - cmd = nargs[0] - cmd = os.path.join(os.path.dirname(cmd), "openerp-gevent") - nargs[0] = cmd + cmd = os.path.join(os.path.dirname(nargs[0]), "odoo.py") + nargs = [cmd, 'gevent'] + nargs[1:] popen = subprocess.Popen([sys.executable] + nargs) self.long_polling_pid = popen.pid diff --git a/openerp-gevent b/openerp-gevent deleted file mode 100755 index 1514cb53fbbdd..0000000000000 --- a/openerp-gevent +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env python - -import gevent.monkey -gevent.monkey.patch_all() -import psycogreen.gevent -psycogreen.gevent.patch_psycopg() - -import odoo - -if __name__ == "__main__": - odoo.cli.main() diff --git a/setup.py b/setup.py index a1535bbfa7b9e..b62718249155b 100644 --- a/setup.py +++ b/setup.py @@ -58,7 +58,6 @@ def py2exe_options(): return { 'console': [ {'script': 'odoo.py'}, - {'script': 'openerp-gevent'}, {'script': 'openerp-server', 'icon_resources': [ (1, join('setup', 'win32', 'static', 'pixmaps', 'openerp-icon.ico')) ]}, @@ -130,7 +129,7 @@ def py2exe_options(): author_email=author_email, classifiers=filter(None, classifiers.split('\n')), license=license, - scripts=['openerp-server', 'openerp-gevent', 'odoo.py'], + scripts=['openerp-server', 'odoo.py'], packages=find_packages(), package_dir={'%s' % lib_name: 'openerp'}, include_package_data=True,