Skip to content

Commit e773b7c

Browse files
Remove unreachable code after retry loops
Deleted unreachable RuntimeError raises from provider modules where retry loops always return or raise, improving code clarity.
1 parent 2865f9d commit e773b7c

File tree

10 files changed

+0
-30
lines changed

10 files changed

+0
-30
lines changed

python/mllmcelltype/providers/anthropic.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,3 @@ def process_anthropic(
167167
time.sleep(wait_time)
168168
else:
169169
raise
170-
171-
# Unreachable: loop always returns or raises
172-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/deepseek.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,3 @@ def process_deepseek(
155155
else:
156156
write_log(f"All retry attempts failed. Last error: {str(e)}", level="error")
157157
raise
158-
159-
# Unreachable: loop always returns or raises
160-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/gemini.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,3 @@ def process_gemini(
7575
time.sleep(wait_time)
7676
else:
7777
raise
78-
79-
# Unreachable: loop always returns or raises
80-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/grok.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,3 @@ def process_grok(
9393
time.sleep(wait_time)
9494
else:
9595
raise
96-
97-
# Unreachable: loop always returns or raises
98-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/minimax.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,3 @@ def process_minimax(
130130
time.sleep(wait_time)
131131
else:
132132
raise
133-
134-
# Unreachable: loop always returns or raises
135-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/openai.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,3 @@ def process_openai(
100100
time.sleep(wait_time)
101101
else:
102102
raise
103-
104-
# Unreachable: loop always returns or raises
105-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/openrouter.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,3 @@ def process_openrouter(
115115
time.sleep(wait_time)
116116
else:
117117
raise
118-
119-
# Unreachable: loop always returns or raises
120-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/qwen.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,3 @@ def process_qwen(
101101
time.sleep(wait_time)
102102
else:
103103
raise
104-
105-
# Unreachable: loop always returns or raises
106-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/stepfun.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,3 @@ def process_stepfun(
102102
time.sleep(wait_time)
103103
else:
104104
raise
105-
106-
# Unreachable: loop always returns or raises
107-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

python/mllmcelltype/providers/zhipu.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,3 @@ def process_zhipu(
102102
time.sleep(wait_time)
103103
else:
104104
raise
105-
106-
# Unreachable: loop always returns or raises
107-
raise RuntimeError("Unexpected: retry loop completed without return or raise")

0 commit comments

Comments
 (0)