bulix.org / pastebin

Paste #83660: Untitled ASCII paste by 46.218.232.202

#!/usr/bin/env python

import sys
import pdb

MODULE_NAMES = ("bz2", "codecs", "curses", "xml", "readline",
                "ssl", "unicodedata", "sqlite3", "zlib")

MODULE_TESTS = {
    'codecs': lambda m: m.getincrementalencoder("cn")
}

def test_modules():
    success = list()
    for mod_name in MODULE_NAMES:
        try:
            mod = __import__(mod_name, globals(), locals())
            if mod_name in MODULE_TESTS:
                MODULE_TESTS[mod_name](mod)
            success.append(mod_name)
        except Exception as e:
            print("=" * 80)
            print("Could not load '%s'" % mod_name)
            print("-" * 80)
            pdb.traceback.print_exc()
            print()
    print("=" * 80)
    for mod_name in success:
        print("Loading '%s' succedded" % mod_name)
    print()

if __name__ == "__main__":
    test_modules()

New paste


Private
Wrap long lines

4 + 3 =