{"thread":{"id":"16563","subject":"git-p4, SyntaxError: invalid syntax","startedAt":"2008-12-02T19:08:09Z","lastAt":"2008-12-02T19:45:04Z","messageCount":2,"participants":["Gary Yang","Jason Foreman"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"96976","messageId":"186027.87419.qm@web37901.mail.mud.yahoo.com","threadId":"16563","inReplyTo":null,"subject":"git-p4, SyntaxError: invalid syntax","fromName":"Gary Yang","fromEmail":"garyyang6@yahoo.com","sentAt":"2008-12-02T19:08:09Z","receivedAt":"2008-12-02T19:08:09Z","isPatch":false,"sender":{"key":"garyyang6@yahoo.com","avatar":null},"body":"\nI got git-p4 from “git clone git://git.kernel.org/pub/scm/git/git.git git”\nI copied git-p4 from contrib/fast-import/git-p4 to /home/gyang/bin\n\nI got SyntaxError  when I ran,\n\ngit-p4 clone //depot/Workshop\n\n/home/gyang/bin/git-p4:161: Warning: 'yield' will become a reserved keyword in the future\n  File \"/user/svdc/pluo/bin/git-p4\", line 161\n    yield pattern\n                ^\nSyntaxError: invalid syntax\n\nI opened the file, git-p4. There are three import lines. I am not python programmer. Maybe I missed something in python? I have python installed at /usr/local/bin/python\n\nwhich python\n/usr/local/bin/python\n\nvi git-p4\nimport optparse, sys, os, marshal, popen2, subprocess, shelve\nimport tempfile, getopt, sha, os.path, time, platform\nimport re\n\nCan someone tell me what I missed?\n\nThanks.\n\n\n\n\n      \n"},{"id":"96977","messageId":"f9aa767e0812021145v1ecc9c56k6ad06ac7678e3d0d@mail.gmail.com","threadId":"16563","inReplyTo":"186027.87419.qm@web37901.mail.mud.yahoo.com","subject":"Re: git-p4, SyntaxError: invalid syntax","fromName":"Jason Foreman","fromEmail":"jason@threeve.org","sentAt":"2008-12-02T19:45:04Z","receivedAt":"2008-12-02T19:45:04Z","isPatch":false,"sender":{"key":"jason@threeve.org","avatar":null},"body":"On Tue, Dec 2, 2008 at 1:08 PM, Gary Yang <garyyang6@yahoo.com> wrote:\n>\n> /home/gyang/bin/git-p4:161: Warning: 'yield' will become a reserved keyword in the future\n>  File \"/user/svdc/pluo/bin/git-p4\", line 161\n>    yield pattern\n>                ^\n> SyntaxError: invalid syntax\n>\n\nThis seems to indicate that your python doesn't support the \"yield\"\nkeyword (used in generators).\n\nAre you using Python 2.2?  If so, that is a very old Python and I'd\nrecommend upgrading.  But even with 2.2 you can fix this by adding the\nfollowing import line:\n\nfrom __future__ import generators\n\nI'm not familiar with the git-p4 file specifically but the above\nshould hopefully fix your problem.\n\n\nCheers,\n\nJason\n"}]}