This patch disables the ability to run packages/Python/lldbsuite/test/dotest.py as a standalone script by explicitly erroring out if it detects that to be the case. Then, it fixes up the place where dosep exec's the script to actually exect the main script that we're running from, instead of hardcoding a path to dotest.py, which is now wrong in the presence of being imported as a package.
We were having trouble running the script from the top level earlier and were directly calling the one that you're disabling. That'll be nice to get the top level one working again.
I hadn't seen the "import main_ as main" trick before. Interesting approach!