[py-svn] r36690 - py/dist/py
hpk at codespeak.net
hpk at codespeak.net
Sat Jan 13 19:07:23 CET 2007
Author: hpk
Date: Sat Jan 13 19:07:21 2007
New Revision: 36690
Modified:
py/dist/py/initpkg.py
Log:
we don't want to play any magic here, so stripping the
comments (i already fixed the tracer invocation to deal
with __dict__ being done)
Modified: py/dist/py/initpkg.py
==============================================================================
--- py/dist/py/initpkg.py (original)
+++ py/dist/py/initpkg.py Sat Jan 13 19:07:21 2007
@@ -209,24 +209,14 @@
# force all the content of the module to be loaded when __dict__ is read
dictdescr = ModuleType.__dict__['__dict__']
dict = dictdescr.__get__(self)
- if not dict:
- # we are called very early, before __init__()
- # executed ... so we just return here ...
- #if dict is None:
- # # is there a more elegant way to trigger
- # # creation of the __dict__ from CPython?
- # ModuleType.__setattr__(self, '_', None)
- # d = dictdescr.__get__(self)
- # del d['_']
- # return d
- return dict
- if '*' not in self.__map__:
- for name in self.__map__.keys():
- hasattr(self, name) # force attribute to be loaded, ignore errors
- assert not self.__map__, "%r not empty" % self.__map__
- else:
- fsname = self.__map__['*'][0]
- dict.update(self.__package__._loadimpl(fsname[:-3]).__dict__)
+ if dict is not None:
+ if '*' not in self.__map__:
+ for name in self.__map__.keys():
+ hasattr(self, name) # force attribute to be loaded, ignore errors
+ assert not self.__map__, "%r not empty" % self.__map__
+ else:
+ fsname = self.__map__['*'][0]
+ dict.update(self.__package__._loadimpl(fsname[:-3]).__dict__)
return dict
__dict__ = property(getdict)
More information about the pytest-commit
mailing list