git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Give python a chance to find "backported" modules
@ 2005-11-16  2:33 Johannes Schindelin
  2005-11-16  3:06 ` Junio C Hamano
  2005-11-18 13:18 ` Johannes Schindelin
  0 siblings, 2 replies; 4+ messages in thread
From: Johannes Schindelin @ 2005-11-16  2:33 UTC (permalink / raw)
  To: git, junkio


python 2.2.1 is perfectly capable of executing git-merge-recursive,
provided that it finds heapq and sets. All you have to do is to steal
heapq.py and sets.py from python 2.3 or newer, and drop them in your
GIT_PYTHON_PATH. 

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	I noted that the python modules are installed uncompiled,
	i.e. *.py but not *.pyc. Is this intended?

 git-merge-recursive.py |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

applies-to: 2a67ad9e41fc614c7848ceff43f4b60b99cf932d
dfd75a554e84139ddce7b62ec82ef94254da1573
diff --git a/git-merge-recursive.py b/git-merge-recursive.py
index 1bf73f3..d7d36aa 100755
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
@@ -3,11 +3,13 @@
 # Copyright (C) 2005 Fredrik Kuivinen
 #
 
-import sys, math, random, os, re, signal, tempfile, stat, errno, traceback
+import sys
+sys.path.append('''@@GIT_PYTHON_PATH@@''')
+
+import math, random, os, re, signal, tempfile, stat, errno, traceback
 from heapq import heappush, heappop
 from sets import Set
 
-sys.path.append('''@@GIT_PYTHON_PATH@@''')
 from gitMergeCommon import *
 
 outputIndent = 0
---
0.99.9.GIT

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] Give python a chance to find "backported" modules
  2005-11-16  2:33 [PATCH] Give python a chance to find "backported" modules Johannes Schindelin
@ 2005-11-16  3:06 ` Junio C Hamano
  2005-11-16  8:02   ` Johannes Schindelin
  2005-11-18 13:18 ` Johannes Schindelin
  1 sibling, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2005-11-16  3:06 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git, junkio

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

> python 2.2.1 is perfectly capable of executing git-merge-recursive,
> provided that it finds heapq and sets. All you have to do is to steal
> heapq.py and sets.py from python 2.3 or newer, and drop them in your
> GIT_PYTHON_PATH. 

Fair enough.  But I do not think we would want to go further
than this.  Especially, shipping a copy of heapq and sets like
we did for subprocess.

Thanks anyway.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Give python a chance to find "backported" modules
  2005-11-16  3:06 ` Junio C Hamano
@ 2005-11-16  8:02   ` Johannes Schindelin
  0 siblings, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2005-11-16  8:02 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi,

On Tue, 15 Nov 2005, Junio C Hamano wrote:

> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > python 2.2.1 is perfectly capable of executing git-merge-recursive,
> > provided that it finds heapq and sets. All you have to do is to steal
> > heapq.py and sets.py from python 2.3 or newer, and drop them in your
> > GIT_PYTHON_PATH. 
> 
> Fair enough.  But I do not think we would want to go further
> than this.  Especially, shipping a copy of heapq and sets like
> we did for subprocess.

Yes. That was my intention.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Give python a chance to find "backported" modules
  2005-11-16  2:33 [PATCH] Give python a chance to find "backported" modules Johannes Schindelin
  2005-11-16  3:06 ` Junio C Hamano
@ 2005-11-18 13:18 ` Johannes Schindelin
  1 sibling, 0 replies; 4+ messages in thread
From: Johannes Schindelin @ 2005-11-18 13:18 UTC (permalink / raw)
  To: git

Hi,

On Wed, 16 Nov 2005, Johannes Schindelin wrote:

> python 2.2.1 is perfectly capable of executing git-merge-recursive,

Well, no.

Actually, my tests ran, but only because they were trivial, or next to it. 
In line 477 of git-merge-recursive.py, there is a reference to an __iter__ 
member of a list (the recs object). Python 2.2.1 does not know about that, 
but rather wants to do the iteration over the collection iter(recs). 
However, this does not work, as some of the contained objects have to be 
skipped.

So I bit the bullet, compiled Python 2.4.2, and it works. Sorry for the 
noise.

Ciao,
Dscho

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-11-18 13:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-16  2:33 [PATCH] Give python a chance to find "backported" modules Johannes Schindelin
2005-11-16  3:06 ` Junio C Hamano
2005-11-16  8:02   ` Johannes Schindelin
2005-11-18 13:18 ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).