# HG changeset patch # User Simon Cross # Date 1302440810 -7200 # Node ID b7c432ce1b803d30b3fad83c173afa15c0c41ee0 # Parent e4242abff4015e117340a9250f608c5ee94f7ab4 Project against absences of __file__. diff -r e4242abff401 -r b7c432ce1b80 scripts/skaapsteker --- a/scripts/skaapsteker Sun Apr 10 15:06:16 2011 +0200 +++ b/scripts/skaapsteker Sun Apr 10 15:06:50 2011 +0200 @@ -2,7 +2,11 @@ import os.path import sys -sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) + +if '__file__' in globals(): + # protect against missing __file__ in Windows executable scripts + # (in these cases, assume skaapsteker is already on the path) + sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) import skaapsteker.__main__ if __name__ == "__main__":