Don't import the portage.dbapi.dbapi class as portage.dbapi anymore, since
authorZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:54:43 +0000 (20:54 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 2 Mar 2010 20:54:43 +0000 (20:54 -0000)
it results in a strange namespace collision (portage.dbapi is both a class
and a module). Hopefully this won't break any api consumers since it's a pure
 virtual class anyway. (trunk r15420)

svn path=/main/branches/2.1.7/; revision=15642

pym/portage/__init__.py

index 06b06c4e27f097c06e820517ef3dae81cb5893a0..35604c6206c1166c829541f9d50ef97bd417bb04 100644 (file)
@@ -83,7 +83,7 @@ try:
                'portage.data',
                'portage.data:lchown,ostype,portage_gid,portage_uid,secpass,' + \
                        'uid,userland,userpriv_groups,wheelgid',
-               'portage.dbapi:dbapi',
+               'portage.dbapi',
                'portage.dbapi.bintree:bindbapi,binarytree',
                'portage.dbapi.porttree:close_portdbapi_caches,FetchlistDict,' + \
                        'portagetree,portdbapi',
@@ -2102,9 +2102,10 @@ class config(object):
 
                        #getting categories from an external file now
                        categories = [grabfile(os.path.join(x, "categories")) for x in locations]
+                       category_re = dbapi.dbapi._category_re
                        self.categories = tuple(sorted(
                                x for x in stack_lists(categories, incremental=1)
-                               if dbapi._category_re.match(x) is not None))
+                               if category_re.match(x) is not None))
                        del categories
 
                        archlist = [grabfile(os.path.join(x, "arch.list")) for x in locations]