[pypy-commit] pyrepl py3ksupport: use unnamed argument expansion for passing event data to a command

RonnyPfannschmidt noreply at buildbot.pypy.org
Wed Oct 19 10:44:58 CEST 2011


Author: Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
Branch: py3ksupport
Changeset: r145:007debcdb09f
Date: 2011-10-19 10:34 +0200
http://bitbucket.org/pypy/pyrepl/changeset/007debcdb09f/

Log:	use unnamed argument expansion for passing event data to a command

diff --git a/pyrepl/commands.py b/pyrepl/commands.py
--- a/pyrepl/commands.py
+++ b/pyrepl/commands.py
@@ -33,10 +33,12 @@
 class Command(object):
     finish = 0
     kills_digit_arg = 1
-    def __init__(self, reader, (event_name, event)):
+
+    def __init__(self, reader, event_name, event):
         self.reader = reader
         self.event = event
         self.event_name = event_name
+
     def do(self):
         pass
 
diff --git a/pyrepl/reader.py b/pyrepl/reader.py
--- a/pyrepl/reader.py
+++ b/pyrepl/reader.py
@@ -517,7 +517,7 @@
         #print cmd
         if isinstance(cmd[0], str):
             cmd = self.commands.get(cmd[0],
-                                    commands.invalid_command)(self, cmd)
+                                    commands.invalid_command)(self, *cmd)
         elif isinstance(cmd[0], type):
             cmd = cmd[0](self, cmd)
 


More information about the pypy-commit mailing list