| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 96f581c commit 4c227e6
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -695,10 +695,19 @@ def test_init_from_config(self): | |||
| 695 | 695 | ||
| 696 | 696 | 'pycache_prefix': 'conf_pycache_prefix', | |
| 697 | 697 | 'program_name': './conf_program_name', | |
| 698 | - 'argv': ['-c', 'arg2'], | ||
| 698 | + 'argv': ['-c', 'arg2', ], | ||
| 699 | 699 | 'parse_argv': 1, | |
| 700 | - 'xoptions': ['xoption1=3', 'xoption2=', 'xoption3'], | ||
| 701 | - 'warnoptions': ['error::ResourceWarning', 'default::BytesWarning'], | ||
| 700 | + 'xoptions': [ | ||
| 701 | + 'config_xoption1=3', | ||
| 702 | + 'config_xoption2=', | ||
| 703 | + 'config_xoption3', | ||
| 704 | + 'cmdline_xoption', | ||
| 705 | + ], | ||
| 706 | + 'warnoptions': [ | ||
| 707 | + 'config_warnoption', | ||
| 708 | + 'cmdline_warnoption', | ||
| 709 | + 'default::BytesWarning', | ||
| 710 | + ], | ||
| 702 | 711 | 'run_command': 'pass\n', | |
| 703 | 712 | ||
| 704 | 713 | 'site_import': 0, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,7 +62,7 @@ pymain_init(const _PyArgv *args) | |||
| 62 | 62 | PyConfig config; | |
| 63 | 63 | status = PyConfig_InitPythonConfig(&config); | |
| 64 | 64 | if (_PyStatus_EXCEPTION(status)) { | |
| 65 | - return status; | ||
| 65 | + goto done; | ||
| 66 | 66 | } | |
| 67 | 67 | ||
| 68 | 68 | /* pass NULL as the config: config is read from command line arguments, | |
@@ -74,14 +74,18 @@ pymain_init(const _PyArgv *args) | |||
| 74 | 74 | status = PyConfig_SetArgv(&config, args->argc, args->wchar_argv); | |
| 75 | 75 | } | |
| 76 | 76 | if (_PyStatus_EXCEPTION(status)) { | |
| 77 | - return status; | ||
| 77 | + goto done; | ||
| 78 | 78 | } | |
| 79 | 79 | ||
| 80 | 80 | status = Py_InitializeFromConfig(&config); | |
| 81 | 81 | if (_PyStatus_EXCEPTION(status)) { | |
| 82 | - return status; | ||
| 82 | + goto done; | ||
| 83 | 83 | } | |
| 84 | - return _PyStatus_OK(); | ||
| 84 | + status = _PyStatus_OK(); | ||
| 85 | + | ||
| 86 | + done: | ||
| 87 | + PyConfig_Clear(&config); | ||
| 88 | + return status; | ||
| 85 | 89 | } | |
| 86 | 90 | ||
| 87 | 91 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -88,7 +88,7 @@ main(int argc, char *argv[]) | |||
| 88 | 88 | config.site_import = 0; | |
| 89 | 89 | ||
| 90 | 90 | status = PyConfig_SetString(&config, &config.program_name, | |
| 91 | - L"./_freeze_importlib"); | ||
| 91 | + L"./_freeze_importlib"); | ||
| 92 | 92 | if (PyStatus_Exception(status)) { | |
| 93 | 93 | PyConfig_Clear(&config); | |
| 94 | 94 | Py_ExitStatusException(status); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments