Mercurial > hg > mercurial-crew
comparison mercurial/util.py @ 12032:ad787252fed6
util: remove lexists, Python 2.4 introduced os.path.lexists
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Wed, 25 Aug 2010 16:23:32 +0200 |
parents | 8380ed691df8 |
children | 5d22e631c365 |
comparison
equal
deleted
inserted
replaced
12031:77bbeafd7519 | 12032:ad787252fed6 |
---|---|
429 raise error.SignatureError | 429 raise error.SignatureError |
430 raise | 430 raise |
431 | 431 |
432 return check | 432 return check |
433 | 433 |
434 # os.path.lexists is not available on python2.3 | |
435 def lexists(filename): | |
436 "test whether a file with this name exists. does not follow symlinks" | |
437 try: | |
438 os.lstat(filename) | |
439 except: | |
440 return False | |
441 return True | |
442 | |
443 def unlink(f): | 434 def unlink(f): |
444 """unlink and remove the directory if it is empty""" | 435 """unlink and remove the directory if it is empty""" |
445 os.unlink(f) | 436 os.unlink(f) |
446 # try removing directories that might now be empty | 437 # try removing directories that might now be empty |
447 try: | 438 try: |