DebugClients/Python3/AsyncFile.py

changeset 2953
703452a2876f
parent 2434
c148e2b8188d
child 2987
c99695c0f13a
equal deleted inserted replaced
2952:94fc661a54a2 2953:703452a2876f
61 61
62 This method checks, if an operation is permitted according to 62 This method checks, if an operation is permitted according to
63 the mode of the file. If it is not, an IOError is raised. 63 the mode of the file. If it is not, an IOError is raised.
64 64
65 @param mode the mode to be checked (string) 65 @param mode the mode to be checked (string)
66 @exception IOError raised to indicate a bad file descriptor
66 """ 67 """
67 if mode != self.mode: 68 if mode != self.mode:
68 raise IOError((9, '[Errno 9] Bad file descriptor')) 69 raise IOError((9, '[Errno 9] Bad file descriptor'))
69 70
70 def __nWrite(self, n): 71 def __nWrite(self, n):
291 def write(self, s): 292 def write(self, s):
292 """ 293 """
293 Public method to write a string to the file. 294 Public method to write a string to the file.
294 295
295 @param s bytes to be written (string) 296 @param s bytes to be written (string)
297 @exception socket.error raised to indicate too many send attempts
296 """ 298 """
297 self.__checkMode('w') 299 self.__checkMode('w')
298 tries = 0 300 tries = 0
299 if not self.wpending: 301 if not self.wpending:
300 self.wpending = s 302 self.wpending = s

eric ide

mercurial