code-server-liek
This commit is contained in:
@@ -16,7 +16,7 @@ def sudo_open(file_path, mode='r', encoding='utf-8'):
|
||||
if result.returncode != 0:
|
||||
raise PermissionError(f"无法读取文件: {file_path}")
|
||||
content = result.stdout
|
||||
yield content
|
||||
return content
|
||||
elif mode == 'w':
|
||||
raise PermissionError(f"不允许以sudo权限写入文件: {file_path}")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user