📄 compat.py
字号:
#!/usr/bin/pythonimport osimport shutil# Closing FDs not supported with subprocess on Windowsclose_fds = Trueif os.name == 'nt': close_fds = False # not supported :(# On Windows, shutil.rmtree doesn't remove files with the read-only# attribute set, so this function explicitly removes it on every error# before retrying. Even on Linux, shutil.rmtree chokes on read-only# directories, so we use this version in all cases.# Fix from http://bitten.edgewall.org/changeset/521def rmtree(root): """Catch shutil.rmtree failures on Windows when files are read-only.""" def _handle_error(fn, path, excinfo): os.chmod(path, 0666) fn(path) return shutil.rmtree(root, onerror=_handle_error)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -