From: Éric Araujo Date: Sun, 6 Nov 2011 10:38:58 +0000 (+0100) Subject: Remove redundant __main__ blocks from packaging modules. X-Git-Tag: v3.3.0a1~914^2~4^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca9460324adb9e744abf95bd57ce1bfca248313f;p=thirdparty%2FPython%2Fcpython.git Remove redundant __main__ blocks from packaging modules. The one interface we commit to maintain is the run module (a.k.a. the pysetup script). --- diff --git a/Lib/packaging/create.py b/Lib/packaging/create.py index de05ac8a199b..5abe47b37dde 100644 --- a/Lib/packaging/create.py +++ b/Lib/packaging/create.py @@ -674,7 +674,3 @@ def main(): # program.write_setup_script() # packaging.util.cfg_to_args() program() - - -if __name__ == '__main__': - main() diff --git a/Lib/packaging/depgraph.py b/Lib/packaging/depgraph.py index 843aab47b080..d633b636ad8c 100644 --- a/Lib/packaging/depgraph.py +++ b/Lib/packaging/depgraph.py @@ -224,6 +224,7 @@ def dependent_dists(dists, dist): def main(): + # XXX move to run._graph from packaging.database import get_distributions tempout = StringIO() try: @@ -267,7 +268,3 @@ def main(): else: print('Supported option: -d [filename]') sys.exit(1) - - -if __name__ == '__main__': - main() diff --git a/Lib/packaging/install.py b/Lib/packaging/install.py index b6816e56b29f..776ba4014c3c 100644 --- a/Lib/packaging/install.py +++ b/Lib/packaging/install.py @@ -527,12 +527,3 @@ def install(project): logger.info('%r conflicts with %s', project, ','.join(projects)) return True - - -def _main(**attrs): - if 'script_args' not in attrs: - attrs['requirements'] = sys.argv[1] - get_infos(**attrs) - -if __name__ == '__main__': - _main()