comparison mercurial/commandserver.py @ 18174:56ef99fbd6f2

commandserver: clean up use of two-argument raise This makes any attempt to port to Python 3 harder, and the new syntax is supported in 2.4 already.
author Augie Fackler <raf@durin42.com>
date Tue, 01 Jan 2013 12:50:04 -0600
parents e95ec38f86b0
children 4b09e6f7d7de
comparison
equal deleted inserted replaced
18173:9916d104c485 18174:56ef99fbd6f2
40 self.out.write(data) 40 self.out.write(data)
41 self.out.flush() 41 self.out.flush()
42 42
43 def __getattr__(self, attr): 43 def __getattr__(self, attr):
44 if attr in ('isatty', 'fileno'): 44 if attr in ('isatty', 'fileno'):
45 raise AttributeError, attr 45 raise AttributeError(attr)
46 return getattr(self.in_, attr) 46 return getattr(self.in_, attr)
47 47
48 class channeledinput(object): 48 class channeledinput(object):
49 """ 49 """
50 Read data from in_. 50 Read data from in_.
120 raise StopIteration 120 raise StopIteration
121 return l 121 return l
122 122
123 def __getattr__(self, attr): 123 def __getattr__(self, attr):
124 if attr in ('isatty', 'fileno'): 124 if attr in ('isatty', 'fileno'):
125 raise AttributeError, attr 125 raise AttributeError(attr)
126 return getattr(self.in_, attr) 126 return getattr(self.in_, attr)
127 127
128 class server(object): 128 class server(object):
129 """ 129 """
130 Listens for commands on stdin, runs them and writes the output on a channel 130 Listens for commands on stdin, runs them and writes the output on a channel