comparison mercurial/windows.py @ 8951:835a51e63c5b

windows: fix use of undefined exception (issue1707) This fixes the implied reliance on pywin32 and the win32 module. This also fixes a regression in ae275ad46bd0 that made Mercurial unusable without pywin32.
author Henrik Stuart <hg@hstuart.dk>
date Thu, 25 Jun 2009 22:43:58 +0200
parents ae275ad46bd0
children 3d456bf32f18
comparison
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