]> granicus.if.org Git - python/commitdiff
bpo-32096: Ensure new embedding test can find the encodings module (GH-4566)
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 26 Nov 2017 04:19:13 +0000 (14:19 +1000)
committerGitHub <noreply@github.com>
Sun, 26 Nov 2017 04:19:13 +0000 (14:19 +1000)
Programs/_testembed.c

index 52a0b5124a37f06f8ef388d488c816649489952c..21aa76e9de38bf279bb6a74c5c65c93f8b34102c 100644 (file)
@@ -132,7 +132,8 @@ static int test_forced_io_encoding(void)
 
 static int test_pre_initialization_api(void)
 {
-    wchar_t *program = Py_DecodeLocale("spam", NULL);
+    /* Leading "./" ensures getpath.c can still find the standard library */
+    wchar_t *program = Py_DecodeLocale("./spam", NULL);
     if (program == NULL) {
         fprintf(stderr, "Fatal error: cannot decode program name\n");
         return 1;