Issue #28226: compileall now supports pathlib
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 67c5f5a..3e45785 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -25,6 +25,8 @@
__all__ = ["compile_dir","compile_file","compile_path"]
def _walk_dir(dir, ddir=None, maxlevels=10, quiet=0):
+ if quiet < 2 and isinstance(dir, os.PathLike):
+ dir = os.fspath(dir)
if not quiet:
print('Listing {!r}...'.format(dir))
try:
@@ -105,6 +107,8 @@
optimize: optimization level or -1 for level of the interpreter
"""
success = True
+ if quiet < 2 and isinstance(fullname, os.PathLike):
+ fullname = os.fspath(fullname)
name = os.path.basename(fullname)
if ddir is not None:
dfile = os.path.join(ddir, name)