Raise ValueError if fromlist contains an extra comma.
authorZac Medico <zmedico@gentoo.org>
Thu, 19 Aug 2010 08:54:16 +0000 (01:54 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 19 Aug 2010 08:54:16 +0000 (01:54 -0700)
pym/portage/proxy/lazyimport.py

index d878b7adcecb91ed0dea403983c991e21edfe995..ad4a54271994dd33963cfc077cb9969d64eb8d04 100644 (file)
@@ -189,6 +189,9 @@ def lazyimport(scope, *args):
                        already_imported = modules.get(name)
                        fromlist = fromlist.split(',')
                        for s in fromlist:
+                               if not s:
+                                       # This happens if there's an extra comma in fromlist.
+                                       raise ValueError('Empty module attribute name')
                                alias = s.split('@', 1)
                                if len(alias) == 1:
                                        alias = alias[0]