From ac41a4566932f1854dfcebe58bfcab75eb4b98b0 Mon Sep 17 00:00:00 2001 From: Franz Zapata Date: Sun, 25 Sep 2016 18:23:45 -0600 Subject: Support running Meson as a Python zip application --- meson.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'meson.py') diff --git a/meson.py b/meson.py index b977368..fbca883 100755 --- a/meson.py +++ b/meson.py @@ -17,8 +17,14 @@ from mesonbuild import mesonmain import sys, os -thisfile = __file__ -if not os.path.isabs(thisfile): - thisfile = os.path.normpath(os.path.join(os.getcwd(), thisfile)) +def main(): + thisfile = __file__ + if not os.path.isabs(thisfile): + thisfile = os.path.normpath(os.path.join(os.getcwd(), thisfile)) + if __package__ == '': + thisfile = os.path.dirname(thisfile) -sys.exit(mesonmain.run(thisfile, sys.argv[1:])) + sys.exit(mesonmain.run(thisfile, sys.argv[1:])) + +if __name__ == '__main__': + main() -- cgit v1.1