1.1 --- a/inspector.py Fri Jan 20 00:08:26 2017 +0100
1.2 +++ b/inspector.py Fri Jan 20 00:09:45 2017 +0100
1.3 @@ -4,7 +4,7 @@
1.4 Inspect and obtain module structure.
1.5
1.6 Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013,
1.7 - 2014, 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.8 + 2014, 2015, 2016, 2017 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -920,6 +920,8 @@
1.13 Process the given "try...except" node 'n'.
1.14 """
1.15
1.16 + self.record_exception_handler()
1.17 +
1.18 tracker = self.trackers[-1]
1.19 tracker.new_branchpoint()
1.20
1.21 @@ -967,6 +969,8 @@
1.22 Process the given "try...finally" node 'n'.
1.23 """
1.24
1.25 + self.record_exception_handler()
1.26 +
1.27 tracker = self.trackers[-1]
1.28 self.process_structure_node(n.body)
1.29
1.30 @@ -1492,4 +1496,12 @@
1.31 self.function_targets[path][0] -= 1
1.32 self.function_arguments[path][0] -= len(args) + 1
1.33
1.34 + # Exceptions.
1.35 +
1.36 + def record_exception_handler(self):
1.37 +
1.38 + "Record the current namespace as employing an exception handler."
1.39 +
1.40 + self.exception_namespaces.add(self.get_namespace_path())
1.41 +
1.42 # vim: tabstop=4 expandtab shiftwidth=4