def random_string(length):
    try:
        import M2Crypto.Rand
        return M2Crypto.Rand.rand_bytes(length)
    except __HOLE__:
        # TODO really strong enough on Linux?
        return os.urandom(length)
dataset/ETHPy150Open apporc/shadowsocks-gtk/shadowsocks_gtk/encrypt.py/random_string