Skip to content

Commit 7c2be8e

Browse files
committed
go
1 parent 1641147 commit 7c2be8e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

codeflash/code_utils/code_extractor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,10 @@ def add_needed_imports_from_module(
362362

363363

364364
def get_code(functions_to_optimize: list[FunctionToOptimize]) -> tuple[str | None, set[tuple[str, str]]]:
365-
"""Return the code for a function or methods in a Python module. functions_to_optimize is either a singleton
366-
FunctionToOptimize instance, which represents either a function at the module level or a method of a class at the
367-
module level, or it represents a list of methods of the same class.
365+
"""Return the code for a function or methods in a Python module.
366+
367+
functions_to_optimize is either a singleton FunctionToOptimize instance, which represents either a function at the
368+
module level or a method of a class at the module level, or it represents a list of methods of the same class.
368369
"""
369370
if (
370371
not functions_to_optimize

codeflash/code_utils/shell_utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ def save_api_key_to_rc(api_key) -> Result[str, str]:
4646
try:
4747
with open(shell_rc_path, "r+", encoding="utf8") as shell_file:
4848
shell_contents = shell_file.read()
49-
if os.name == "nt": # on Windows, we're writing a batch file
50-
if not shell_contents:
51-
shell_contents = "@echo off"
49+
if os.name == "nt" and not shell_contents: # on windows we're writing to a batch file
50+
shell_contents = "@echo off"
5251
existing_api_key = read_api_key_from_shell_config()
5352

5453
if existing_api_key:

0 commit comments

Comments
 (0)