fix: replace bare except with except Exception in tests/dev/plugins
Some checks failed
Cross-Node Transaction Testing / transaction-test (push) Successful in 19s
Deploy to Testnet / deploy-testnet (push) Successful in 1m10s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Node Failover Simulation / failover-test (push) Successful in 1s
Python Tests / test-python (push) Failing after 7s
Deploy to Testnet / notify-deployment (push) Successful in 1s

- Fixed bare except clauses in dev/examples/wallet.py
- Fixed bare except clauses in dev/gpu/gpu_exchange_status.py (2 clauses)
- Fixed bare except clauses in dev/gpu/gpu_miner_host.py
- Fixed bare except clauses in dev/onboarding/auto-onboard.py
- Fixed bare except clauses in dev/onboarding/onboarding-monitor.py
- Fixed bare except clauses in dev/scripts/dev_heartbeat.py
- Fixed bare except clauses in tests/integration/test_blockchain_simple.py (3 clauses)
- Fixed bare except clause in tests/integration/test_full_workflow.py
- Fixed bare except clause in tests/load_test.py
- Fixed bare except clause in tests/security/test_confidential_transactions.py
- Fixed bare except clause in tests/verification/test_coordinator.py
- All bare except clauses now use proper Exception handling
- Addresses remaining ruff E722 warnings in non-critical code
This commit is contained in:
aitbc
2026-04-30 09:17:05 +02:00
parent 7596ef1c1a
commit eb490a186c
13 changed files with 18 additions and 18 deletions

View File

@@ -23,7 +23,7 @@ class AITBCWallet:
try:
with open(self.wallet_file, 'r') as f:
return json.load(f)
except:
except Exception:
pass
# Create new wallet

View File

@@ -43,7 +43,7 @@ try:
print(" 🌐 URL: http://localhost:3002")
else:
print(" ❌ Trade Exchange not responding")
except:
except Exception:
print(" ❌ Trade Exchange not accessible")
# Check Blockchain
@@ -57,7 +57,7 @@ try:
print(f" Block Hash: {data.get('hash', 'Unknown')[:16]}...")
else:
print(" ❌ Blockchain Node not responding")
except:
except Exception:
print(" ❌ Blockchain Node not accessible")
# Show Integration Points

View File

@@ -159,7 +159,7 @@ def wait_for_coordinator():
if response.status_code == 200:
logger.info("Coordinator is available!")
return True
except:
except Exception:
pass
logger.info(f"Waiting for coordinator... ({i+1}/{MAX_RETRIES})")

View File

@@ -147,7 +147,7 @@ class AgentOnboarder:
latency = (datetime.now(datetime.UTC) - start_time).total_seconds()
capabilities['network_latency'] = latency
logger.info(f"✅ Network latency: {latency:.2f}s")
except:
except Exception:
capabilities['network_latency'] = None
logger.warning("⚠️ Could not measure network latency")

View File

@@ -146,7 +146,7 @@ class OnboardingMonitor:
}
return type_mapping.get(compute_type, 'unknown')
except:
except Exception:
return 'unknown'
def calculate_metrics(self):

View File

@@ -126,7 +126,7 @@ def check_vulnerabilities():
count = audit.get("metadata", {}).get("vulnerabilities", {}).get("total", 0)
if count > 0:
issues.append(f"Node dependencies: {count} vulnerabilities (npm audit)")
except:
except Exception:
issues.append("Node dependencies: npm audit failed to parse")
return issues