Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,14 +40,17 @@ def check_code_with_pyflakes(code_str: str) -> str:
|
|
| 40 |
reporter = ErrorReporter()
|
| 41 |
check(code_str, "scene.py", reporter=reporter)
|
| 42 |
|
| 43 |
-
# --- START: New Filtering Logic ---
|
| 44 |
filtered_errors = []
|
| 45 |
for err in reporter.errors:
|
| 46 |
err_str = str(err)
|
| 47 |
-
#
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
filtered_errors.append(err_str)
|
| 50 |
-
|
| 51 |
|
| 52 |
if not filtered_errors:
|
| 53 |
return "" # No errors found
|
|
|
|
| 40 |
reporter = ErrorReporter()
|
| 41 |
check(code_str, "scene.py", reporter=reporter)
|
| 42 |
|
|
|
|
| 43 |
filtered_errors = []
|
| 44 |
for err in reporter.errors:
|
| 45 |
err_str = str(err)
|
| 46 |
+
# --- START: Updated Filtering Logic ---
|
| 47 |
+
# We now ignore BOTH types of star import warnings.
|
| 48 |
+
is_star_import_warning = "may be undefined, or defined from star imports" in err_str
|
| 49 |
+
is_general_import_warning = "'undefined names' found" in err_str
|
| 50 |
+
|
| 51 |
+
if not is_star_import_warning and not is_general_import_warning:
|
| 52 |
filtered_errors.append(err_str)
|
| 53 |
+
# --- END: Updated Filtering Logic ---
|
| 54 |
|
| 55 |
if not filtered_errors:
|
| 56 |
return "" # No errors found
|