comparison mercurial/windows.py @ 8930:ae275ad46bd0

windows: import WinIOError from win32 module (issue1707) Quick fix pending further refactoring of windows error handling.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Wed, 24 Jun 2009 12:03:53 +0200
parents c5f36402daad
children 835a51e63c5b
comparison
equal deleted inserted replaced
8929:cb05e2a00291 8930:ae275ad46bd0
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
11 12
12 nulldev = 'NUL:' 13 nulldev = 'NUL:'
13 umask = 002 14 umask = 002
14 15
15 # wrap osutil.posixfile to provide friendlier exceptions 16 # wrap osutil.posixfile to provide friendlier exceptions
16 def posixfile(name, mode='r', buffering=-1): 17 def posixfile(name, mode='r', buffering=-1):
17 try: 18 try:
18 return osutil.posixfile(name, mode, buffering) 19 return osutil.posixfile(name, mode, buffering)
19 except WindowsError, err: 20 except WindowsError, err:
20 raise WinIOError(err) 21 raise win32.WinIOError(err)
21 posixfile.__doc__ = osutil.posixfile.__doc__ 22 posixfile.__doc__ = osutil.posixfile.__doc__
22 23
23 class winstdout(object): 24 class winstdout(object):
24 '''stdout on windows misbehaves if sent through a pipe''' 25 '''stdout on windows misbehaves if sent through a pipe'''
25 26