Commit a3db5028 authored by Dan Pascu's avatar Dan Pascu

Modified Resources to better detect if running in interactive mode

parent 8b03fd94
...@@ -60,11 +60,10 @@ class Resources(object): ...@@ -60,11 +60,10 @@ class Resources(object):
@classproperty @classproperty
def directory(cls): def directory(cls):
if cls._cached_directory is None: if cls._cached_directory is None:
script = sys.argv[0] if sys.path[0] == '':
if script == '': application_directory = os.path.realpath('') # executed in interactive interpreter
application_directory = os.path.realpath(script) # executed in interactive interpreter
else: else:
binary_directory = os.path.dirname(os.path.realpath(script)) binary_directory = os.path.dirname(os.path.realpath(sys.argv[0]))
if os.path.basename(binary_directory) == 'bin': if os.path.basename(binary_directory) == 'bin':
application_directory = os.path.dirname(binary_directory) application_directory = os.path.dirname(binary_directory)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment