OS X distributive was pointing to the wrong path for the pyfa root, due to the executable being in a different place than the actual root. This changes the logic to use sys.executable as a fallback when __file__ doesn't exist (for example in the windows distributive)

This commit is contained in:
blitzmann
2015-10-08 15:23:51 -04:00
parent a67b46bb9a
commit f090cafa5c
2 changed files with 2 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ def isFrozen():
return False
def getPyfaRoot():
base = sys.executable if isFrozen() else sys.argv[0]
base = getattr(sys.modules['__main__'], "__file__", sys.executable) if isFrozen() else sys.argv[0]
root = os.path.dirname(os.path.realpath(os.path.abspath(base)))
root = unicode(root, sys.getfilesystemencoding())
return root

View File

@@ -34,7 +34,7 @@ def DrawFilledBitmap(width, height, color):
def DrawGradientBar(width, height, gStart, gEnd, gMid = None, fillRatio = 4):
# we need to have dimensions to draw
assert width > 0 and height > 0
#assert width > 0 and height > 0
canvas = wx.EmptyBitmap(width,height)
mdc = wx.MemoryDC()