Use newer style exception syntax in upload.py