Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
fix empty sys.argv[0] in loader
Browse files Browse the repository at this point in the history
  • Loading branch information
SAPikachu committed Mar 15, 2011
1 parent 1cbadab commit dbb9e81
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion encx264.py
Expand Up @@ -3,7 +3,13 @@

# support build script
sys.path.append(os.path.join(os.path.dirname(sys.path[0]), "pyd"))

if not sys.argv[0]:
entry_point = sys.path[0]
if (not entry_point.lower().endswith(".py")) and \
(not entry_point.lower().endswith(".exe")):
entry_point = os.path.join(entry_point, "encx264.py")
sys.argv[0] = entry_point

if len(sys.argv) > 1 and sys.argv[1][0] == "!":
from impls.functions import functions
name = sys.argv[1][1:]
Expand Down

0 comments on commit dbb9e81

Please sign in to comment.