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):
@classproperty
def directory(cls):
if cls._cached_directory is None:
script = sys.argv[0]
if script == '':
application_directory = os.path.realpath(script) # executed in interactive interpreter
if sys.path[0] == '':
application_directory = os.path.realpath('') # executed in interactive interpreter
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':
application_directory = os.path.dirname(binary_directory)
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