On Tue, Feb 5, 2013 at 5:51 PM, Laxmikant Chitare
wrote:
> One more thing, apart from what Albert mentioned.
> Exceptions must be classes or instances. In effect you cannot just do
> 'raise'. 'raise' statement must be followed by a class or an instance.
You can inside an except clause.
>>> try:
One more thing, apart from what Albert mentioned.
Exceptions must be classes or instances. In effect you cannot just do
'raise'. 'raise' statement must be followed by a class or an instance.
On Tue, Feb 5, 2013 at 6:28 AM, Albert Hopkins wrote:
>
>
> On Mon, Feb 4, 2013, at 04:49 PM, Rodrick Br
On Mon, Feb 4, 2013, at 04:49 PM, Rodrick Brown wrote:
> For the life of me I cant figure out why this exception is being thrown.
> How could I use pdb to debug this?
>
> $ python udp_local2.py server
> File "udp_local2.py", line 36
> except:
> ^
> SyntaxError: invalid syntax
>
>
Should it not be "try-except-else' instead of 'if-except-else'?
try:
if delay > 2.0:
raise RuntimeError('I think the server is down')
except:
raise
else:
break
On Mon, Feb 4, 2013 at 5:21 PM,
Rodrick Brown wrote:
> For the life of me I cant figure out why this exception is being thrown.
> How could I use pdb to debug this?
>
> $ python udp_local2.py server
> File "udp_local2.py", line 36
> except:
> ^
> SyntaxError: invalid syntax
You can't use pdb to debug it, because
On Tue, Feb 5, 2013 at 8:49 AM, Rodrick Brown wrote:
> if delay > 2.0:
> raise RuntimeError('I think the server is down')
> except:
> raise
> else:
> break
I think you have an indentation error here. Backtab the e
For the life of me I cant figure out why this exception is being thrown.
How could I use pdb to debug this?
$ python udp_local2.py server
File "udp_local2.py", line 36
except:
^
SyntaxError: invalid syntax
#!/usr/bin/env python
import random, socket, sys
s = socket.socket(socket.