Dec-20-2018, 09:22 PM
i pressed
^C
and got:Output:Traceback (most recent call last):
File "tree.py", line 52, in <module>
names=sorted(listdir(path))
NotADirectoryError: [Errno 20] Not a directory: 'projects/avlmap-0.12.4/CONFIG/readsymlink.c'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "xyzzy.py", line 52, in <module>
names=sorted(listdir(path))
KeyboardInterrupt
part of the reason for this is that line 52 is in a try: clause, so exceptions are being handled there.try: names=sorted(listdir(path)) except: names=[]what if i wanted to specifically handle KeyboardInterrupt in the code that calls this code, and the KeyboardInterrupt happens during the handling of NotADirectoryError, or other kinds of exceptions is cases of other code? will it be able to keep the exceptions apart when there is a handler for each? what if i am doing a recursive call from inside of a try: clause in a recursive function for an asynchronous kind of exception (like KeyboardInterrupt) and two (or more) such exceptions happen together while the recursion is at least two (or more) deep? i am concerned that the nesting of exception events won't always be handled as if they all happened separately.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.