Restore Python2.4 compatibility.

- remove X if T else Y syntax
- try hashlib, fall back to sha

Change-Id: Iffabba6cea736bd104de69205c130ff6bb212445
2 files changed