diff --git a/dev/examples/wallet.py b/dev/examples/wallet.py index 918b5555..99de3b3f 100755 --- a/dev/examples/wallet.py +++ b/dev/examples/wallet.py @@ -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 diff --git a/dev/gpu/gpu_exchange_status.py b/dev/gpu/gpu_exchange_status.py index b8364888..157c2f34 100755 --- a/dev/gpu/gpu_exchange_status.py +++ b/dev/gpu/gpu_exchange_status.py @@ -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 diff --git a/dev/gpu/gpu_miner_host.py b/dev/gpu/gpu_miner_host.py index 9086f041..b4351f64 100755 --- a/dev/gpu/gpu_miner_host.py +++ b/dev/gpu/gpu_miner_host.py @@ -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})") diff --git a/dev/onboarding/auto-onboard.py b/dev/onboarding/auto-onboard.py index 6f6fe516..d5461aac 100755 --- a/dev/onboarding/auto-onboard.py +++ b/dev/onboarding/auto-onboard.py @@ -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") diff --git a/dev/onboarding/onboarding-monitor.py b/dev/onboarding/onboarding-monitor.py index 22704758..80f8c3a0 100755 --- a/dev/onboarding/onboarding-monitor.py +++ b/dev/onboarding/onboarding-monitor.py @@ -146,7 +146,7 @@ class OnboardingMonitor: } return type_mapping.get(compute_type, 'unknown') - except: + except Exception: return 'unknown' def calculate_metrics(self): diff --git a/dev/scripts/dev_heartbeat.py b/dev/scripts/dev_heartbeat.py index f39f79a0..7e81fcdf 100755 --- a/dev/scripts/dev_heartbeat.py +++ b/dev/scripts/dev_heartbeat.py @@ -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 diff --git a/plugins/example_plugin.py b/plugins/example_plugin.py index b4c43be0..cf36fa96 100755 --- a/plugins/example_plugin.py +++ b/plugins/example_plugin.py @@ -120,7 +120,7 @@ class ExamplePlugin(BasePlugin): try: process = psutil.Process(os.getpid()) self._memory_usage = process.memory_info().rss - except: + except Exception: self._memory_usage = 0 uptime = None diff --git a/tests/integration/test_blockchain_final.py b/tests/integration/test_blockchain_final.py index 63489933..43f7aa23 100644 --- a/tests/integration/test_blockchain_final.py +++ b/tests/integration/test_blockchain_final.py @@ -27,7 +27,7 @@ def test_nodes(): response = httpx.get(f"{node['url']}/openapi.json", timeout=5) api_ok = response.status_code == 200 print(f" RPC API: {'✅' if api_ok else '❌'}") - except: + except Exception: api_ok = False print(f" RPC API: ❌") @@ -48,7 +48,7 @@ def test_nodes(): ) faucet_ok = response.status_code == 200 print(f" Faucet: {'✅' if faucet_ok else '❌'}") - except: + except Exception: faucet_ok = False print(f" Faucet: ❌") @@ -60,7 +60,7 @@ def test_nodes(): }) else: print(f" Chain Head: ❌") - except: + except Exception: print(f" Chain Head: ❌") # Summary diff --git a/tests/integration/test_blockchain_simple.py b/tests/integration/test_blockchain_simple.py index 0e57426d..5513e03b 100644 --- a/tests/integration/test_blockchain_simple.py +++ b/tests/integration/test_blockchain_simple.py @@ -26,7 +26,7 @@ def test_node_basic_functionality(): try: response = httpx.get(f"{url}/openapi.json", timeout=5) print(f" ✅ Node responsive") - except: + except Exception: print(f" ❌ Node not responding") continue @@ -38,7 +38,7 @@ def test_node_basic_functionality(): print(f" ✅ Chain height: {head.get('height', 'unknown')}") else: print(f" ❌ Failed to get chain head") - except: + except Exception: print(f" ❌ Error getting chain head") # Test faucet @@ -52,7 +52,7 @@ def test_node_basic_functionality(): print(f" ✅ Faucet working") else: print(f" ❌ Faucet failed: {response.status_code}") - except: + except Exception: print(f" ❌ Error testing faucet") def show_networking_config(): diff --git a/tests/integration/test_full_workflow.py b/tests/integration/test_full_workflow.py index 0015f665..8671622f 100644 --- a/tests/integration/test_full_workflow.py +++ b/tests/integration/test_full_workflow.py @@ -231,7 +231,7 @@ class TestMarketplaceIntegration: if response.status_code == 200: services = response.json() assert isinstance(services, list) - except: + except Exception: # API endpoint might not be available, that's OK pass diff --git a/tests/load_test.py b/tests/load_test.py index 6b9cd283..53becad3 100644 --- a/tests/load_test.py +++ b/tests/load_test.py @@ -41,6 +41,6 @@ class AITBCUser(HttpUser): "payload": "0x", "chain_id": "ait-mainnet" }) - except: + except Exception: # Expected to fail due to invalid signature, but tests endpoint availability pass diff --git a/tests/security/test_confidential_transactions.py b/tests/security/test_confidential_transactions.py index 17a4baea..6cca5aaa 100644 --- a/tests/security/test_confidential_transactions.py +++ b/tests/security/test_confidential_transactions.py @@ -248,7 +248,7 @@ class TestConfidentialTransactionSecurity: x25519.X25519PrivateKey.generate(), x25519.X25519PrivateKey.generate().public_key(), ) - except: + except Exception: pass # Expected to fail with wrong keys end = time.perf_counter() times.append(end - start) diff --git a/tests/verification/test_coordinator.py b/tests/verification/test_coordinator.py index 1a753c85..12ee33f6 100644 --- a/tests/verification/test_coordinator.py +++ b/tests/verification/test_coordinator.py @@ -27,7 +27,7 @@ for endpoint in endpoints: try: data = response.json() print(f" Response: {json.dumps(data, indent=2)[:200]}...") - except: + except Exception: print(f" Response: {response.text[:100]}...") except Exception as e: print(f"{endpoint}: Error - {e}")