diff --git a/mypy/dmypy.py b/mypy/dmypy.py index 9040f3818a88..b0219e608f43 100644 --- a/mypy/dmypy.py +++ b/mypy/dmypy.py @@ -492,6 +492,9 @@ def is_running() -> bool: # Run main(). +def console_entry() -> None: + main(sys.argv[1:]) + if __name__ == '__main__': - main(sys.argv[1:]) + console_entry() diff --git a/setup.py b/setup.py index 0aaf3e6ef672..8ab67dc44c90 100644 --- a/setup.py +++ b/setup.py @@ -157,7 +157,7 @@ def run(self): package_data={'mypy': package_data}, entry_points={'console_scripts': ['mypy=mypy.__main__:console_entry', 'stubgen=mypy.stubgen:main', - 'dmypy=mypy.dmypy:main', + 'dmypy=mypy.dmypy:console_entry', ]}, classifiers=classifiers, cmdclass=cmdclass,