Skip to content

Commit e81442d

Browse files
committed
Remove patch_stdout calls; that's a problem for another time
1 parent 7a45d5b commit e81442d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib/python/pyflyby/_modules.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import os
1515
import pathlib
1616
import pkgutil
17-
from prompt_toolkit.patch_stdout \
18-
import patch_stdout
1917
import textwrap
2018

2119
from pyflyby._fast_iter_modules \
@@ -70,12 +68,11 @@ def _remove_import_cache_dir(path: pathlib.Path):
7068
try:
7169
shutil.rmtree(str(path))
7270
except Exception as e:
73-
with patch_stdout(raw=True):
74-
logger.error(
75-
f"Failed to remove cache directory at {path} - please "
76-
"consider removing this directory manually. Error:\n"
77-
f"{textwrap.indent(str(e), prefix=' ')}"
78-
)
71+
logger.error(
72+
f"Failed to remove cache directory at {path} - please "
73+
"consider removing this directory manually. Error:\n"
74+
f"{textwrap.indent(str(e), prefix=' ')}"
75+
)
7976

8077

8178
@memoize
@@ -613,8 +610,7 @@ def _cached_module_finder(
613610
for path in cache_dir.iterdir():
614611
_remove_import_cache_dir(path)
615612

616-
with patch_stdout(raw=True):
617-
logger.info(f"Rebuilding cache for {_format_path(importer.path)}...")
613+
logger.info(f"Rebuilding cache for {_format_path(importer.path)}...")
618614

619615
modules = _iter_file_finder_modules(importer, SUFFIXES)
620616
with open(cache_file, 'w') as fp:

0 commit comments

Comments
 (0)