Elm: Fix module init from embedded interpreter

sys.argv doesn't exist there
This commit is contained in:
Kai Huuhko 2015-05-09 20:16:45 +03:00
parent 1011cb76df
commit 73938af391
1 changed files with 12 additions and 12 deletions

View File

@ -366,11 +366,11 @@ def init():
# FIXME: Why are we passing the cl args to elm_init here?
cdef:
int argc, i, arg_len
char **argv
int argc = 0, i, arg_len
char **argv = NULL
char *arg
int ret
if hasattr(sys, "argv"):
argc = len(sys.argv)
argv = <char **>PyMem_Malloc(argc * sizeof(char *))
for i in range(argc):