]> granicus.if.org Git - python/commitdiff
bpo-20443: Fix calculate_program_full_path() warning (GH-14446)
authorVictor Stinner <vstinner@redhat.com>
Fri, 28 Jun 2019 14:49:38 +0000 (16:49 +0200)
committerGitHub <noreply@github.com>
Fri, 28 Jun 2019 14:49:38 +0000 (16:49 +0200)
Don't call _Py_isabs() with a bytes string (char*), the function
expects as wide string.

Modules/getpath.c

index 751c0b79e8fafa9c4e3226b27a4b16358fedec68..4ddb6638fa855e2b05a9b5ff8991ad600dbec439 100644 (file)
@@ -761,7 +761,7 @@ calculate_program_full_path(const PyConfig *config,
       * absolutize() should help us out below
       */
     else if(0 == _NSGetExecutablePath(execpath, &nsexeclength) &&
-            _Py_isabs(execpath))
+            (wchar_t)execpath[0] == SEP)
     {
         size_t len;
         wchar_t *path = Py_DecodeLocale(execpath, &len);