added __name__ and sys.argv[0] in pypy setup script

This commit is contained in:
Unbit
2013-05-21 00:37:02 +02:00
parent 3a7ba3675b
commit 0e1de3d6e8
3 changed files with 11 additions and 0 deletions
+4
View File
@@ -3984,3 +3984,7 @@ void create_msg_pipe(int *fd, int bufsize) {
}
}
}
char *uwsgi_binary_path() {
return uwsgi.binary_path ? uwsgi.binary_path : "uwsgi";
}
+5
View File
@@ -5,6 +5,7 @@ sys.path.extend(os.environ.get('PYTHONPATH','').split(os.pathsep))
import imp
import traceback
__name__ = '__main__'
mainmodule = type(sys)('__main__')
sys.modules['__main__'] = mainmodule
@@ -32,6 +33,8 @@ struct uwsgi_opt {
int configured;
};
char *uwsgi_binary_path();
int uwsgi_response_write_body_do(void *, char *, uint64_t);
int uwsgi_response_sendfile_do_can_close(void *, int, uint64_t, uint64_t, int);
int uwsgi_response_prepare_headers(void *, char *, uint16_t);
@@ -65,6 +68,8 @@ it sucks, i will fix it in the near future...
"""
wsgi_application = None
sys.argv.insert(0, ffi.string(lib.uwsgi_binary_path()))
"""
load a wsgi module
"""
+2
View File
@@ -4015,6 +4015,8 @@ void uwsgi_mule_run(void);
void uwsgi_spooler_run(void);
void uwsgi_takeover(void);
char *uwsgi_binary_path(void);
void uwsgi_check_emperor(void);
#ifdef UWSGI_AS_SHARED_LIBRARY
int uwsgi_init(int, char **, char **);