utils/scanpypi: don't pass any arguments to main()
authorAlexey Roslyakov <alexey.roslyakov@gmail.com>
Thu, 20 Jul 2017 05:26:37 +0000 (12:26 +0700)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Thu, 20 Jul 2017 20:27:58 +0000 (22:27 +0200)
'if __name__ == "__main__"' idiom typically calls main function that
doesn't take any arguments in most cases. We shouldn't pass any tuple to
it.
I've tested the script with python-idna-2.5 and now it works with this
little change.

Signed-off-by: Alexey Roslyakov <alexey.roslyakov@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
utils/scanpypi

index bb3899241b73d71ddfcfcfcd81b4864719723ffd..9abf3c4139c04d9f6869bd91c1bd5096ad38f32c 100755 (executable)
@@ -255,12 +255,12 @@ class BuildrootPackage():
             # called through the if __name__ == '__main__' directive.
             # In this case, we can only pray that it is called through a
             # function called main() in setup.py.
-            setup.main([]) # Will raise AttributeError if not found
+            setup.main() # Will raise AttributeError if not found
             self.setup_metadata = self.setup_args[self.metadata_name]
         # Here we must remove the module the hard way.
         # We must do this because of a very specific case: if a package calls
         # setup from the __main__ but does not come with a 'main()' function,
-        # for some reason setup.main([]) will successfully call the main
+        # for some reason setup.main() will successfully call the main
         # function of a previous package...
         sys.modules.pop('setup',None)
         del setup