mercurial/windows.py
changeset 8951 835a51e63c5b
parent 8930 ae275ad46bd0
child 9099 3d456bf32f18
equal deleted inserted replaced
8950:be6b57b2bdb8 8951:835a51e63c5b
     6 # GNU General Public License version 2, incorporated herein by reference.
     6 # GNU General Public License version 2, incorporated herein by reference.
     7 
     7 
     8 from i18n import _
     8 from i18n import _
     9 import osutil, error
     9 import osutil, error
    10 import errno, msvcrt, os, re, sys
    10 import errno, msvcrt, os, re, sys
    11 from mercurial import win32
       
    12 
    11 
    13 nulldev = 'NUL:'
    12 nulldev = 'NUL:'
    14 umask = 002
    13 umask = 002
    15 
    14 
    16 # wrap osutil.posixfile to provide friendlier exceptions
    15 # wrap osutil.posixfile to provide friendlier exceptions
    17 def posixfile(name, mode='r', buffering=-1):
    16 def posixfile(name, mode='r', buffering=-1):
    18     try:
    17     try:
    19         return osutil.posixfile(name, mode, buffering)
    18         return osutil.posixfile(name, mode, buffering)
    20     except WindowsError, err:
    19     except WindowsError, err:
    21         raise win32.WinIOError(err)
    20         raise IOError(err.errno, err.strerror)
    22 posixfile.__doc__ = osutil.posixfile.__doc__
    21 posixfile.__doc__ = osutil.posixfile.__doc__
    23 
    22 
    24 class winstdout(object):
    23 class winstdout(object):
    25     '''stdout on windows misbehaves if sent through a pipe'''
    24     '''stdout on windows misbehaves if sent through a pipe'''
    26 
    25