Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/50707 )

Change subject: python: Get rid of some unused cruft in main.py.
......................................................................

python: Get rid of some unused cruft in main.py.

There was some code at the end of main.py which would let you run it
directly. This would parse options passed to the script, and show you
what they equaled.

Also, the "main" function would optionally let you pass in options to
override whatever it would find with parse_arguments. This is no longer
used.

Change-Id: Ib0effa7ac2b4a51b68994372a7c7fcf1c9b4dc13
---
M src/python/m5/main.py
1 file changed, 2 insertions(+), 19 deletions(-)



diff --git a/src/python/m5/main.py b/src/python/m5/main.py
index f3be50f..37a7002 100644
--- a/src/python/m5/main.py
+++ b/src/python/m5/main.py
@@ -214,7 +214,7 @@

     fatal("Tracing is not enabled.  Compile with TRACING_ON")

-def main(*args):
+def main():
     import m5
     import _m5.core

@@ -229,12 +229,7 @@
     from .util import inform, fatal, panic, isInteractive
     from m5.util.terminal_formatter import TerminalFormatter

-    if len(args) == 0:
-        options, arguments = parse_options()
-    elif len(args) == 2:
-        options, arguments = args
-    else:
- raise TypeError("main() takes 0 or 2 arguments (%d given)" % len(args))
+    options, arguments = parse_options()

     m5.options = options

@@ -462,15 +457,3 @@
     # once the script is done
     if options.interactive:
         interact(scope)
-
-if __name__ == '__main__':
-    from pprint import pprint
-
-    options, arguments = parse_options()
-
-    print('opts:')
-    pprint(options, indent=4)
-    print()
-
-    print('args:')
-    pprint(arguments, indent=4)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50707
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ib0effa7ac2b4a51b68994372a7c7fcf1c9b4dc13
Gerrit-Change-Number: 50707
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to