Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def modify_file(file_path):
|
|
70 |
"""
|
71 |
Modify specific lines in a file.
|
72 |
|
73 |
-
Replace lines 107 and 108 with `raise ImportError
|
74 |
"""
|
75 |
try:
|
76 |
# Read the file contents
|
@@ -78,7 +78,7 @@ def modify_file(file_path):
|
|
78 |
lines = file.readlines()
|
79 |
|
80 |
# Modify the specified lines
|
81 |
-
lines[106] = " raise ImportError("Custom import error message")\n" # Line 107 (index starts at 0)
|
82 |
lines[107] = "" # Line 108, replace with an empty line or remove it
|
83 |
|
84 |
# Write the modified lines back to the file
|
|
|
70 |
"""
|
71 |
Modify specific lines in a file.
|
72 |
|
73 |
+
Replace lines 107 and 108 with a valid `raise ImportError` statement.
|
74 |
"""
|
75 |
try:
|
76 |
# Read the file contents
|
|
|
78 |
lines = file.readlines()
|
79 |
|
80 |
# Modify the specified lines
|
81 |
+
lines[106] = " raise ImportError(\"Custom import error message\")\n" # Line 107 (index starts at 0)
|
82 |
lines[107] = "" # Line 108, replace with an empty line or remove it
|
83 |
|
84 |
# Write the modified lines back to the file
|