def __init__(self, devname = None): if devname is None: self.name = '/dev/urandom' else: self.name = devname f = open(self.name, 'rb', 0) fmode = os.fstat(f.fileno())[stat.ST_MODE] if not stat.S_ISCHR(fmode): f.close() raise TypeError('%r is not a character special device' % (self.name,)) self.__file = f BaseRNG.__init__(self)
def __init__(self, devname=None): if devname is None: self.name = '/dev/urandom' else: self.name = devname f = open(self.name, 'rb', 0) fmode = os.fstat(f.fileno())[stat.ST_MODE] if not stat.S_ISCHR(fmode): f.close() raise TypeError('%r is not a character special device' % (self.name, )) self.__file = f BaseRNG.__init__(self) return
def __init__(self, devname=None): if devname is None: self.name = "/dev/urandom" else: self.name = devname # Test that /dev/urandom is a character special device f = open(self.name, "rb", 0) fmode = os.fstat(f.fileno())[stat.ST_MODE] if not stat.S_ISCHR(fmode): f.close() raise TypeError("%r is not a character special device" % (self.name,)) self.__file = f BaseRNG.__init__(self)
def __init__(self, devname=None): if devname is None: self.name = "/dev/urandom" else: self.name = devname # Test that /dev/urandom is a character special device f = open(self.name, "rb", 0) fmode = os.fstat(f.fileno())[stat.ST_MODE] if not stat.S_ISCHR(fmode): f.close() raise TypeError("%r is not a character special device" % (self.name,)) self.__file = f BaseRNG.__init__(self)
def __init__(self): self._read = os.urandom BaseRNG.__init__(self)
def __init__(self): self.__winrand = winrandom.new() BaseRNG.__init__(self)
def __init__(self): self._read = os.urandom BaseRNG.__init__(self)
def __init__(self): self.__winrand = winrandom.new() BaseRNG.__init__(self)