kuuko pushed a commit to branch master.
commit b6eb161da26f552a1063df118134942cc78d1302
Author: Kai Huuhko <[email protected]>
Date: Sat Apr 6 16:43:22 2013 +0300
Add a 0 length check to api coverage script to prevent division by 0.
---
api_coverage.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/api_coverage.py b/api_coverage.py
index 2e45949..5f939be 100755
--- a/api_coverage.py
+++ b/api_coverage.py
@@ -123,7 +123,7 @@ for key in args.libs:
if args.c:
print("C API functions: {0}".format(len(ecs)))
- if args.python:
+ if args.python and len(ecs) > 0:
percentage = float(len(ecs.intersection(eps))) / float(len(ecs)) *
100.0
print("===")
print("Bindings coverage {0:.2f}%".format(percentage))
--
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire
the most talented Cisco Certified professionals. Visit the
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html