1.1 --- a/micropython/inspect.py Sat Jan 17 23:25:17 2009 +0100
1.2 +++ b/micropython/inspect.py Sun Jan 18 02:09:41 2009 +0100
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Inspect source files, obtaining details of classes and attributes.
1.6
1.7 -Copyright (C) 2007, 2008 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009 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 @@ -630,7 +630,9 @@
1.13 def visitGlobal(self, node):
1.14 if self.namespaces:
1.15 for name in node.names:
1.16 - self.namespaces[-1].make_global(name)
1.17 + ns = self.namespaces[-1]
1.18 + if not ns.make_global(name):
1.19 + raise InspectError(ns.full_name(), node, "Name %r is global and local in %r" % (name, ns.full_name()))
1.20
1.21 # Record a global entry for the name in the module.
1.22