summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2006-07-12 15:18:49 -0400
committerNathan Binkert <binkertn@umich.edu>2006-07-12 15:18:49 -0400
commit3218538740a6132273875f84ce0cb95a2c79a62d (patch)
tree4f27473ac9e6722b7bb52d228c3c1e0fece9e550 /src
parent7078d8d1b42c1a158c854b3e07800f20aa695bfb (diff)
downloadgem5-3218538740a6132273875f84ce0cb95a2c79a62d.tar.xz
Fix __file__ for scripts
src/python/m5/main.py: set __file__ to the script, not the m5 binary. --HG-- extra : convert_revision : a0bbd059d2fd321ae8ff68225abc8a7bb5c410ed
Diffstat (limited to 'src')
-rw-r--r--src/python/m5/main.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index 904b241ca..80dbcb5aa 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -283,9 +283,10 @@ def main():
objects.ExecutionTrace.print_fetchseq = options.print_fetch_seq
objects.ExecutionTrace.print_cpseq = options.print_cpseq
- scope = { '__file__' : sys.argv[0] }
sys.argv = arguments
sys.path = [ os.path.dirname(sys.argv[0]) ] + sys.path
+
+ scope = { '__file__' : sys.argv[0] }
exec("import readline", scope)
execfile(sys.argv[0], scope)