view tools/base64 @ 5429:daa19de102a2

Python 3 preparation: make fallback SysCallError an actual exception class. The code defines a fallback version of SysCallError when import of OpenSSL.SSL. But in Python 3, defining it as None and then using in "except" statements results in: TypeError: catching classes that do not inherit from BaseException is not allowed
author Joseph Myers <jsm@polyomino.org.uk>
date Wed, 25 Jul 2018 09:56:22 +0000
parents c75defc1c2f0
children 9c3ec0a5c7fc
line wrap: on
line source

#!/usr/bin/env python
from __future__ import print_function
import zlib, base64, sys
print(base64.encodestring(zlib.compress(sys.stdin.read())))

Roundup Issue Tracker: http://roundup-tracker.org/