devendergarg14 commited on
Commit
479bed7
·
verified ·
1 Parent(s): 7de6028

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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
- # This is the key: we ignore the specific warnings about star imports.
48
- if "may be undefined, or defined from star imports" not in err_str:
 
 
 
 
49
  filtered_errors.append(err_str)
50
- # --- END: New Filtering Logic ---
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