Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with the __main__ file #36

Open
JnyJny opened this issue Feb 1, 2024 · 0 comments
Open

Problems with the __main__ file #36

JnyJny opened this issue Feb 1, 2024 · 0 comments

Comments

@JnyJny
Copy link

JnyJny commented Feb 1, 2024

if __name__ == "__main__":
dist = distribution("bundlefun")
data_path = dist.locate_file("log-formats.json")
print(type(data_path), data_path)
exit(main())

You are missing an import to make this go:

from importlib.metadata import distribution

if __name__  == "__main__":

     success = True
    dist = distribution("bundlefun")
    path = dist.locate_file(...)
    ...
    return 0 if success else 1

The final line in your code exit(main()) is going to fail since you haven't written a main function to be called.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant