From 1fc184caceeadd4e909b6a1333bdced5909198ab Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Sat, 6 Jan 2018 19:02:14 +1100 Subject: [PATCH] Replaced exec with getattr --- src/PIL/ImageCms.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/PIL/ImageCms.py b/src/PIL/ImageCms.py index 40fb1ad0a..b4a81a799 100644 --- a/src/PIL/ImageCms.py +++ b/src/PIL/ImageCms.py @@ -960,10 +960,11 @@ if __name__ == "__main__": print(__doc__) - for f in dir(sys.modules[__name__]): + module = sys.modules[__name__] + for f in dir(module): doc = None try: - exec("doc = %s.__doc__" % (f)) + doc = getattr(module, f).__doc__ if "pyCMS" in doc: # so we don't get the __doc__ string for imported modules print("=" * 80)