5c5d70e-fix-embedded-dealloc-argv-more-3.5.patch 648 B

1234567891011121314151617
  1. --- contrib/tools/cython/Cython/Utility/Embed.c (index)
  2. +++ contrib/tools/cython/Cython/Utility/Embed.c (working tree)
  3. @@ -234,7 +234,12 @@ int
  4. res = 0;
  5. setlocale(LC_ALL, "");
  6. for (i = 0; i < argc; i++) {
  7. - argv_copy2[i] = argv_copy[i] = __Pyx_char2wchar(argv[i]);
  8. + argv_copy2[i] = argv_copy[i] =
  9. +#if PY_VERSION_HEX < 0x03050000
  10. + __Pyx_char2wchar(argv[i]);
  11. +#else
  12. + Py_DecodeLocale(argv[i], NULL);
  13. +#endif
  14. if (!argv_copy[i]) res = 1; /* failure, but continue to simplify cleanup */
  15. }
  16. setlocale(LC_ALL, oldloc);
  17. free(oldloc);