From b9cdd0fb9c463c2503a4d854bb6529a9db58fe1b Mon Sep 17 00:00:00 2001 From: Eric Snow Date: Sat, 16 Oct 2021 13:16:08 -0600 Subject: bpo-45020: Default to using frozen modules unless running from source tree. (gh-28940) The default was "off". Switching it to "on" means users get the benefit of frozen stdlib modules without having to do anything. There's a special-case for running-in-source-tree, so contributors don't get surprised when their stdlib changes don't get used. https://bugs.python.org/issue45020 --- Python/fileutils.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Python/fileutils.c') diff --git a/Python/fileutils.c b/Python/fileutils.c index 173d34dd23..3d8f3a4f16 100644 --- a/Python/fileutils.c +++ b/Python/fileutils.c @@ -2169,6 +2169,18 @@ _Py_add_relfile(wchar_t *dirname, const wchar_t *relfile, size_t bufsize) } +size_t +_Py_find_basename(const wchar_t *filename) +{ + for (size_t i = wcslen(filename); i > 0; --i) { + if (filename[i] == SEP) { + return i + 1; + } + } + return 0; +} + + /* Get the current directory. buflen is the buffer size in wide characters including the null character. Decode the path from the locale encoding. -- cgit v1.2.1