Skip to content

Commit

Permalink
removing the dependency on the io module because some environments tr…
Browse files Browse the repository at this point in the history
…ow an error
  • Loading branch information
FabienArcellier committed Jan 22, 2024
1 parent 437d0c8 commit 22b13a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/alfred/self_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
>>> # check the command integrity
>>> # alfred --check
"""
import io
import os
from typing import List, Optional

Expand Down Expand Up @@ -100,11 +99,11 @@ def _scaffhold_command(project_dir: str, module_target: str, tpl_command_variabl
target_file = os.path.join(project_dir, module_target)
if os.path.isfile(target_file) is False:
new_module = resource.template('command_module_new.tpl', variables=tpl_command_variables)
with io.open(target_file, 'w', encoding='utf-8') as filep:
with open(target_file, 'w', encoding='utf-8') as filep:
filep.write(new_module)
else:
append_in_module = resource.template('command_module_existing.tpl', variables=tpl_command_variables)
with io.open(target_file, 'a', encoding='utf-8') as filep:
with open(target_file, 'a', encoding='utf-8') as filep:
filep.write(append_in_module)


Expand Down

0 comments on commit 22b13a2

Please sign in to comment.