Replaced exec with getattr

This commit is contained in:
Andrew Murray 2018-01-06 19:02:14 +11:00
parent 0ac6d6ad52
commit 1fc184cace

View File

@ -960,10 +960,11 @@ if __name__ == "__main__":
print(__doc__) print(__doc__)
for f in dir(sys.modules[__name__]): module = sys.modules[__name__]
for f in dir(module):
doc = None doc = None
try: try:
exec("doc = %s.__doc__" % (f)) doc = getattr(module, f).__doc__
if "pyCMS" in doc: if "pyCMS" in doc:
# so we don't get the __doc__ string for imported modules # so we don't get the __doc__ string for imported modules
print("=" * 80) print("=" * 80)