/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/osutils.py

  • Committer: Robey Pointer
  • Date: 2006-09-03 00:13:54 UTC
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060903001354-1f596a529c9c4934
remove usage of hasattr

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
if lexists is None:
151
151
    def lexists(f):
152
152
        try:
153
 
            if hasattr(os, 'lstat'):
 
153
            if getattr(os, 'lstat') != None:
154
154
                os.lstat(f)
155
155
            else:
156
156
                os.stat(f)
195
195
        if e.errno not in (None, errno.ENOENT, errno.ENOTDIR):
196
196
            raise
197
197
    except Exception, e:
198
 
        if (not hasattr(e, 'errno') 
 
198
        if (getattr(e, 'errno', None) == None
199
199
            or e.errno not in (errno.ENOENT, errno.ENOTDIR)):
200
200
            raise
201
201
    else:
370
370
 
371
371
 
372
372
def normalizepath(f):
373
 
    if hasattr(os.path, 'realpath'):
 
373
    if getattr(os.path, 'realpath', None) != None:
374
374
        F = realpath
375
375
    else:
376
376
        F = abspath
505
505
 
506
506
 
507
507
def sha_file(f):
508
 
    if hasattr(f, 'tell'):
 
508
    if getattr(f, 'tell', None) != None:
509
509
        assert f.tell() == 0
510
510
    s = sha.new()
511
511
    BUFSIZE = 128<<10
726
726
 
727
727
 
728
728
def has_symlinks():
729
 
    if hasattr(os, 'symlink'):
 
729
    if getattr(os, 'symlink', None) != None:
730
730
        return True
731
731
    else:
732
732
        return False