Mercurial > hg
comparison mercurial/cmdutil.py @ 17391:fc24c10424d2 stable
util: replace util.nulldev with os.devnull
Python since 2.4 has supported os.devnull so having util.nulldev
is unnecessary.
author | Ross Lagerwall <rosslagerwall@gmail.com> |
---|---|
date | Sat, 04 Aug 2012 07:14:40 +0200 |
parents | 2e0805f59736 |
children | e7cfe3587ea4 bacde764fba0 |
comparison
equal
deleted
inserted
replaced
17389:59581b667cd7 | 17391:fc24c10424d2 |
---|---|
513 os.unlink(lockpath) | 513 os.unlink(lockpath) |
514 util.hidewindow() | 514 util.hidewindow() |
515 sys.stdout.flush() | 515 sys.stdout.flush() |
516 sys.stderr.flush() | 516 sys.stderr.flush() |
517 | 517 |
518 nullfd = os.open(util.nulldev, os.O_RDWR) | 518 nullfd = os.open(os.devnull, os.O_RDWR) |
519 logfilefd = nullfd | 519 logfilefd = nullfd |
520 if logfile: | 520 if logfile: |
521 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND) | 521 logfilefd = os.open(logfile, os.O_RDWR | os.O_CREAT | os.O_APPEND) |
522 os.dup2(nullfd, 0) | 522 os.dup2(nullfd, 0) |
523 os.dup2(logfilefd, 1) | 523 os.dup2(logfilefd, 1) |