From: SourceForge.net <no...@so...> - 2006-09-21 00:54:46
|
Bugs item #1562575, was opened at 2006-09-21 00:54 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1562575&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Jythonc compiler Group: None Status: Open Resolution: None Priority: 5 Submitted By: Jesse Glick (jglick) Assigned to: Nobody/Anonymous (nobody) Summary: yield keyword from Hg gives syntax error Initial Comment: Using Jython 2.2a1, I tried to load Mercurial v. 0.9.1, just enough to call --version. But I just get a parse error: $ /tmp/hjg --version Traceback (innermost last): File "<stdin>", line 3, in ? File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line 58 yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact ^ SyntaxError: invalid syntax The wrapper script, FWIW (based on Linux FC5): #!/bin/sh /tmp/jythonRelease_2_2alpha1/jython - <<PYTHON import sys sys.path.append("/usr/lib/python2.4/site-packages") from mercurial import commands commands.run() PYTHON Sources: http://www.selenic.com/mercurial/release/mercurial-0.9.1.tar.gz Surrounding text (sorry if this gets reformatted): def makewalk(repo, pats, opts, node=None, head='', badmatch=None): files, matchfn, anypats = matchpats(repo, pats, opts, head) exact = dict(zip(files, files)) def walk(): for src, fn in repo.walk(node=node, files=files, match=matchfn, badmatch=badmatch): yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact return files, matchfn, walk() ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1562575&group_id=12867 |
From: SourceForge.net <no...@so...> - 2006-09-21 14:06:39
|
Bugs item #1562575, was opened at 2006-09-20 19:54 Message generated for change (Comment added) made by cgroves You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1562575&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Core Group: None >Status: Closed >Resolution: Invalid Priority: 5 Submitted By: Jesse Glick (jglick) Assigned to: Nobody/Anonymous (nobody) Summary: yield keyword from Hg gives syntax error Initial Comment: Using Jython 2.2a1, I tried to load Mercurial v. 0.9.1, just enough to call --version. But I just get a parse error: $ /tmp/hjg --version Traceback (innermost last): File "<stdin>", line 3, in ? File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line 58 yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact ^ SyntaxError: invalid syntax The wrapper script, FWIW (based on Linux FC5): #!/bin/sh /tmp/jythonRelease_2_2alpha1/jython - <<PYTHON import sys sys.path.append("/usr/lib/python2.4/site-packages") from mercurial import commands commands.run() PYTHON Sources: http://www.selenic.com/mercurial/release/mercurial-0.9.1.tar.gz Surrounding text (sorry if this gets reformatted): def makewalk(repo, pats, opts, node=None, head='', badmatch=None): files, matchfn, anypats = matchpats(repo, pats, opts, head) exact = dict(zip(files, files)) def walk(): for src, fn in repo.walk(node=node, files=files, match=matchfn, badmatch=badmatch): yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact return files, matchfn, walk() ---------------------------------------------------------------------- >Comment By: Charles Groves (cgroves) Date: 2006-09-21 09:06 Message: Logged In: YES user_id=1174327 yield doesn't appear by default until 2.3. You can use it in 2.2 by adding 'from __future__ import generators' to the beginning of your wrapper script. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1562575&group_id=12867 |
From: SourceForge.net <no...@so...> - 2006-09-21 17:14:23
|
Bugs item #1562575, was opened at 2006-09-21 00:54 Message generated for change (Comment added) made by jglick You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1562575&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Closed Resolution: Invalid Priority: 5 Submitted By: Jesse Glick (jglick) Assigned to: Nobody/Anonymous (nobody) Summary: yield keyword from Hg gives syntax error Initial Comment: Using Jython 2.2a1, I tried to load Mercurial v. 0.9.1, just enough to call --version. But I just get a parse error: $ /tmp/hjg --version Traceback (innermost last): File "<stdin>", line 3, in ? File "/usr/lib/python2.4/site-packages/mercurial/commands.py", line 58 yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact ^ SyntaxError: invalid syntax The wrapper script, FWIW (based on Linux FC5): #!/bin/sh /tmp/jythonRelease_2_2alpha1/jython - <<PYTHON import sys sys.path.append("/usr/lib/python2.4/site-packages") from mercurial import commands commands.run() PYTHON Sources: http://www.selenic.com/mercurial/release/mercurial-0.9.1.tar.gz Surrounding text (sorry if this gets reformatted): def makewalk(repo, pats, opts, node=None, head='', badmatch=None): files, matchfn, anypats = matchpats(repo, pats, opts, head) exact = dict(zip(files, files)) def walk(): for src, fn in repo.walk(node=node, files=files, match=matchfn, badmatch=badmatch): yield src, fn, util.pathto(repo.getcwd(), fn), fn in exact return files, matchfn, walk() ---------------------------------------------------------------------- >Comment By: Jesse Glick (jglick) Date: 2006-09-21 17:14 Message: Logged In: YES user_id=257383 Actually it needs to be placed inside each source file using 'yield', not in the wrapper script, but yes that solves the syntax error problem. Other errors still occur when trying to use Hg, so I guess I'll just wait for a future Jython release before trying again. ---------------------------------------------------------------------- Comment By: Charles Groves (cgroves) Date: 2006-09-21 14:06 Message: Logged In: YES user_id=1174327 yield doesn't appear by default until 2.3. You can use it in 2.2 by adding 'from __future__ import generators' to the beginning of your wrapper script. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1562575&group_id=12867 |