Any pointers as to why `pants run` executes my fi...
# general
b
Any pointers as to why
pants run
executes my file two times? I'm using run to debug some code, but the stdout indicates that everything executes twice. I can reproduce by just calling a python file
libs/some-project/some_module/__init__.py
containing
print("hello")
Ex:
Copy code
$ pants run libs/some-project/some_module/__init__.py 
hello
hello
1
1
g
This happens without Pants as well.
Copy code
$ mkdir foobar
$ echo 'print("hello")' >> foobar/__init__.py
$ python -m foobar.__init__
hello
hello
The reason is that it has to import the module
foobar
before executing
__init__.py
.
b
😩... I was so fixated on
pants
that I did not even think about Python workings. Thank you!
🙇 1