mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-22 06:13:51 -07:00
Inverted condition in python check so it defaults to new code now.
This commit is contained in:
parent
997e5aac3e
commit
96d8528a0a
1 changed files with 13 additions and 13 deletions
|
@ -403,7 +403,9 @@ static int CmdScriptRun(const char *Cmd) {
|
||||||
// hook Proxmark3 API
|
// hook Proxmark3 API
|
||||||
PyImport_AppendInittab("_pm3", PyInit__pm3);
|
PyImport_AppendInittab("_pm3", PyInit__pm3);
|
||||||
#endif
|
#endif
|
||||||
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 10
|
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 10
|
||||||
|
Py_Initialize();
|
||||||
|
#else
|
||||||
PyConfig py_conf;
|
PyConfig py_conf;
|
||||||
PyConfig_InitIsolatedConfig(&py_conf);
|
PyConfig_InitIsolatedConfig(&py_conf);
|
||||||
// Despite being isolated we probably want to allow users to use
|
// Despite being isolated we probably want to allow users to use
|
||||||
|
@ -411,15 +413,22 @@ static int CmdScriptRun(const char *Cmd) {
|
||||||
// as system ones. But it seems isolated mode still enforces them off.
|
// as system ones. But it seems isolated mode still enforces them off.
|
||||||
py_conf.use_environment = 1;
|
py_conf.use_environment = 1;
|
||||||
py_conf.user_site_directory = 1;
|
py_conf.user_site_directory = 1;
|
||||||
#else
|
|
||||||
Py_Initialize();
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//int argc, char ** argv
|
//int argc, char ** argv
|
||||||
char *argv[128];
|
char *argv[128];
|
||||||
argv[0] = filename;
|
argv[0] = filename;
|
||||||
int argc = split(arguments, &argv[1]);
|
int argc = split(arguments, &argv[1]);
|
||||||
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 10
|
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 10
|
||||||
|
wchar_t *py_args[argc + 1];
|
||||||
|
for (int i = 0; i <= argc; i++) {
|
||||||
|
py_args[i] = Py_DecodeLocale(argv[i], NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
PySys_SetArgv(argc + 1, py_args);
|
||||||
|
|
||||||
|
// clean up
|
||||||
|
#else
|
||||||
// The following line will implicitly pre-initialize Python
|
// The following line will implicitly pre-initialize Python
|
||||||
PyConfig_SetBytesArgv(&py_conf, argc + 1, argv);
|
PyConfig_SetBytesArgv(&py_conf, argc + 1, argv);
|
||||||
// This is required by Proxspace to work with an isolated Python configuration
|
// This is required by Proxspace to work with an isolated Python configuration
|
||||||
|
@ -429,15 +438,6 @@ static int CmdScriptRun(const char *Cmd) {
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
PyConfig_Clear(&py_conf);
|
PyConfig_Clear(&py_conf);
|
||||||
#else
|
|
||||||
wchar_t *py_args[argc + 1];
|
|
||||||
for (int i = 0; i <= argc; i++) {
|
|
||||||
py_args[i] = Py_DecodeLocale(argv[i], NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
PySys_SetArgv(argc + 1, py_args);
|
|
||||||
|
|
||||||
// clean up
|
|
||||||
#endif
|
#endif
|
||||||
for (int i = 0; i < argc; ++i) {
|
for (int i = 0; i < argc; ++i) {
|
||||||
free(argv[i + 1]);
|
free(argv[i + 1]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue