File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 11import json
2- import os
32import readline
43import stat
54from pathlib import Path
@@ -117,14 +116,14 @@ def save_user_config(self, dest_path: Path) -> None:
117116 if self ._is_valid_path (dest_path ):
118117 target = dest_path / self ._user_config_file
119118 target .write_text (self .user_config_to_json ())
120- os .chmod (target , stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
119+ target .chmod (stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
121120
122121 def save_user_creds (self , dest_path : Path ) -> None :
123122 if self ._is_valid_path (dest_path ):
124123 if user_creds := self .user_credentials_to_json ():
125124 target = dest_path / self ._user_creds_file
126125 target .write_text (user_creds )
127- os .chmod (target , stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
126+ target .chmod (stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
128127
129128 def save (self , dest_path : Path | None = None ) -> None :
130129 dest_path = dest_path or self ._default_save_path
Original file line number Diff line number Diff line change @@ -257,7 +257,7 @@ def peak(self, output: str | bytes) -> bool:
257257 peek_output_log .write (str (output ))
258258
259259 if change_perm :
260- os .chmod (str ( peak_logfile ), stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
260+ peak_logfile .chmod (stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
261261
262262 sys .stdout .write (str (output ))
263263 sys .stdout .flush ()
@@ -317,7 +317,7 @@ def execute(self) -> bool:
317317 cmd_log .write (f"{ time .time ()} { self .cmd } \n " )
318318
319319 if change_perm :
320- os .chmod (str ( history_logfile ), stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
320+ history_logfile .chmod (stat .S_IRUSR | stat .S_IWUSR | stat .S_IRGRP )
321321 except (PermissionError , FileNotFoundError ):
322322 # If history_logfile does not exist, ignore the error
323323 pass
You can’t perform that action at this time.
0 commit comments