On Feb 11, 7:12 pm, mk mrk...@gmail.com wrote:
Peter Otten wrote:
try:
...
except socket.error:
...
#untested
import socket
class SocketWrapper:
def __getattr__(self, name):
return getattr(socket, name)
error = None
import module_using_socket
Peter Otten __pete...@web.de wrote:
You could try to shadow the exception class with None:
ZeroDivisionError = None
try:
... 1/0
... except ZeroDivisionError:
... print caught
...
Traceback (most recent call last):
File stdin, line 2, in module
ZeroDivisionError: integer
Duncan Booth wrote:
Peter Otten __pete...@web.de wrote:
You could try to shadow the exception class with None:
This works in Python 2.x but will break in Python 3. None is not a valid
exception specification and Python 3 will check for that and complain.
A better solution is to use an
Hello everyone,
I'm getting an exception (on socket) handled in a program I'm trying to
debug. I have trouble locating where exactly that happens.
In such situation turning exception handling off could be useful, bc
unhandled exception stack trace is precisely what I'm trying to obtain.
mk wrote:
Hello everyone,
I'm getting an exception (on socket) handled in a program I'm trying to
debug. I have trouble locating where exactly that happens.
In such situation turning exception handling off could be useful, bc
unhandled exception stack trace is precisely what I'm trying to
Steve Holden wrote:
I'm getting an exception (on socket) handled in a program I'm trying to
debug. I have trouble locating where exactly that happens.
If the exception is currently being trapped by a handler in your code
It's not my code.
you could just insert a raise statement at the
On 11 February 2010 16:17, mk mrk...@gmail.com wrote:
I'm getting an exception (on socket) handled in a program I'm trying to
debug. I have trouble locating where exactly that happens.
In such situation turning exception handling off could be useful, bc
unhandled exception stack trace is
Simon Brunning wrote:
Not as far as I know. Besides, the chances are that if you were to be
able to turn off exception handling altogether your code wouldn't make
it as far as the code you are interested in anyway.
Sure, but I could deal with that, jerry-rigging the code as exceptions
go by,
On Thu, Feb 11, 2010 at 9:32 AM, mk mrk...@gmail.com wrote:
Simon Brunning wrote:
Not as far as I know. Besides, the chances are that if you were to be
able to turn off exception handling altogether your code wouldn't make
it as far as the code you are interested in anyway.
Sure, but I
the uncommon, the exceptional, case. If one could somehow turn off
exceptions, you can't even do a for loop: every for loop would become
infinite-- exceptions are how Python signals the end of an iterator.
Think about that, *every* for loop in Python suddenly breaks.
Ouch.
Sure I
mk mrk...@gmail.com writes:
Um... run your code in a debugger.
..except the code in question is multithreaded and pdb is no good for
that, and last time I checked, yappi was broken.
Try winpdb.org.
--
http://mail.python.org/mailman/listinfo/python-list
Stephen Hansen wrote:
the uncommon, the exceptional, case. If one could somehow turn off
exceptions, you can't even do a for loop: every for loop would become
infinite-- exceptions are how Python signals the end of an iterator.
Think about that, *every* for loop in Python suddenly breaks.
mk wrote:
the uncommon, the exceptional, case. If one could somehow turn off
exceptions, you can't even do a for loop: every for loop would become
infinite-- exceptions are how Python signals the end of an iterator.
Think about that, *every* for loop in Python suddenly breaks.
Ouch.
mk wrote:
Stephen Hansen wrote:
the uncommon, the exceptional, case. If one could somehow turn off
exceptions, you can't even do a for loop: every for loop would become
infinite-- exceptions are how Python signals the end of an iterator.
Think about that, *every* for loop in Python suddenly
Paul Rubin wrote:
mk mrk...@gmail.com writes:
Um... run your code in a debugger.
..except the code in question is multithreaded and pdb is no good for
that, and last time I checked, yappi was broken.
Try winpdb.org.
This is a treasure! In minutes I've had this attached to remote process
Peter Otten wrote:
try:
...
except socket.error:
...
#untested
import socket
class SocketWrapper:
def __getattr__(self, name):
return getattr(socket, name)
error = None
import module_using_socket
module_using_socket.socket = SocketWrapper()
Very interesting
16 matches
Mail list logo