~mbp/bzr/tags-in-repo-1

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: John Arbash Meinel
  • Date: 2006-10-11 00:23:23 UTC
  • mfrom: (2070 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20061011002323-82ba88c293d7caff
[merge] bzr.dev 2070

Show diffs side-by-side

added added

removed removed

Lines of Context:
654
654
except (NotImplementedError, AttributeError):
655
655
    # If python doesn't have os.urandom, or it doesn't work,
656
656
    # then try to first pull random data from /dev/urandom
657
 
    if os.path.exists("/dev/urandom"):
 
657
    try:
658
658
        rand_bytes = file('/dev/urandom', 'rb').read
659
659
    # Otherwise, use this hack as a last resort
660
 
    else:
 
660
    except (IOError, OSError):
661
661
        # not well seeded, but better than nothing
662
662
        def rand_bytes(n):
663
663
            import random