summaryrefslogtreecommitdiffstats
path: root/Lib/compileall.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-12-23 20:39:55 (GMT)
committerGitHub <noreply@github.com>2022-12-23 20:39:55 (GMT)
commit9c4b8cca09342734eb04fc1093d5952a2317dfb7 (patch)
treecea369050cacf7b631111461bdbe1a602723940e /Lib/compileall.py
parentbd472198c6ab7d69657aa3d70df1320584cf98b2 (diff)
downloadcpython-9c4b8cca09342734eb04fc1093d5952a2317dfb7.zip
cpython-9c4b8cca09342734eb04fc1093d5952a2317dfb7.tar.gz
cpython-9c4b8cca09342734eb04fc1093d5952a2317dfb7.tar.bz2
bpo-40447: accept all path-like objects in compileall.compile_file (GH-19883)
(cherry picked from commit 1ecfd1ebf1f53ef6ac82085b25ed09952b470d4e) Co-authored-by: Filipe Laíns <lains@riseup.net> Signed-off-by: Filipe Laíns <lains@archlinux.org> Signed-off-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Diffstat (limited to 'Lib/compileall.py')
-rw-r--r--Lib/compileall.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 3755e76..50183ea 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -154,8 +154,8 @@ def compile_file(fullname, ddir=None, force=False, rx=None, quiet=0,
"in combination with stripdir or prependdir"))
success = True
- if quiet < 2 and isinstance(fullname, os.PathLike):
- fullname = os.fspath(fullname)
+ fullname = os.fspath(fullname)
+ stripdir = os.fspath(stripdir) if stripdir is not None else None
name = os.path.basename(fullname)
dfile = None