comparison mercurial/windows.py @ 48946:642e31cb55f0

py3: use class X: instead of class X(object): The inheritance from object is implied in Python 3. So this should be equivalent. This change was generated via an automated search and replace. So there may have been some accidental changes. Differential Revision: https://phab.mercurial-scm.org/D12352
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 13:08:28 -0700
parents 563eb25e079b
children d500df2e8034
comparison
equal deleted inserted replaced
48945:55d132525155 48946:642e31cb55f0
51 unlink = win32.unlink 51 unlink = win32.unlink
52 52
53 umask = 0o022 53 umask = 0o022
54 54
55 55
56 class mixedfilemodewrapper(object): 56 class mixedfilemodewrapper:
57 """Wraps a file handle when it is opened in read/write mode. 57 """Wraps a file handle when it is opened in read/write mode.
58 58
59 fopen() and fdopen() on Windows have a specific-to-Windows requirement 59 fopen() and fdopen() on Windows have a specific-to-Windows requirement
60 that files opened with mode r+, w+, or a+ make a call to a file positioning 60 that files opened with mode r+, w+, or a+ make a call to a file positioning
61 function when switching between reads and writes. Without this extra call, 61 function when switching between reads and writes. Without this extra call,
128 128
129 object.__setattr__(self, '_lastop', self.OPREAD) 129 object.__setattr__(self, '_lastop', self.OPREAD)
130 return self._fp.readlines(*args, **kwargs) 130 return self._fp.readlines(*args, **kwargs)
131 131
132 132
133 class fdproxy(object): 133 class fdproxy:
134 """Wraps osutil.posixfile() to override the name attribute to reflect the 134 """Wraps osutil.posixfile() to override the name attribute to reflect the
135 underlying file name. 135 underlying file name.
136 """ 136 """
137 137
138 def __init__(self, name, fp): 138 def __init__(self, name, fp):
212 msvcrt.putwch(u'\r') # pytype: disable=module-attr 212 msvcrt.putwch(u'\r') # pytype: disable=module-attr
213 msvcrt.putwch(u'\n') # pytype: disable=module-attr 213 msvcrt.putwch(u'\n') # pytype: disable=module-attr
214 return encoding.unitolocal(pw) 214 return encoding.unitolocal(pw)
215 215
216 216
217 class winstdout(object): 217 class winstdout:
218 """Some files on Windows misbehave. 218 """Some files on Windows misbehave.
219 219
220 When writing to a broken pipe, EINVAL instead of EPIPE may be raised. 220 When writing to a broken pipe, EINVAL instead of EPIPE may be raised.
221 221
222 When writing too many bytes to a console at the same, a "Not enough space" 222 When writing too many bytes to a console at the same, a "Not enough space"
656 656
657 def isexec(f): 657 def isexec(f):
658 return False 658 return False
659 659
660 660
661 class cachestat(object): 661 class cachestat:
662 def __init__(self, path): 662 def __init__(self, path):
663 pass 663 pass
664 664
665 def cacheable(self): 665 def cacheable(self):
666 return False 666 return False