You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Martin Furter <mf...@rola.ch> on 2003/10/05 19:28:02 UTC

[PATCH] python 2.1 support (build/generator/gen_base.py)

Today i wanted to update svn and got an error in
build/generator/gen_base.py:
TypeError: 'in' or 'not in' needs sequence right argument
ERROR: gen-make.py failed

Here's a patch:

Index: build/generator/gen_base.py
===================================================================
--- build/generator/gen_base.py (revision 7308)
+++ build/generator/gen_base.py (working copy)
@@ -95,7 +95,7 @@
     """Return a list of section objects from a string of section
names."""
     sections = [ ]
     for section_name in string.split(section_list):
-      if section_name not in self.skip_sections:
+      if not self.skip_sections.has_key( section_name ):
         sections.append(self.sections[section_name])
     return sections
 

Thanks
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: Varying code styles (was Re: [PATCH] python 2.1 support (build/generator/gen_base.py))

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
--On Wednesday, October 08, 2003 13:21:48 -0400 Greg Hudson 
<gh...@MIT.EDU> wrote:

> The situation would be a little bit better if we were less laissez-faire
> about code style between files; at least then the people heavily
> involved in the project wouldn't accidentally apply one file's style to
> another file.

+1.  One code style per project is goodness, IMHO.

Even if I think "foo ( param )" is butt-ugly - the added consistency is 
worth it.  ;-)  -- justin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Varying code styles (was Re: [PATCH] python 2.1 support (build/generator/gen_base.py))

Posted by Greg Hudson <gh...@MIT.EDU>.
On Sun, 2003-10-05 at 16:35, C. Michael Pilato wrote:
> This patch looks semantically fine, but (and I really shouldn't have
> to point out stuff like this -- I mean, doesn't everyone take some
> degree of pride in making their code *look* good?) this module doesn't
> use the "foo( param )" coding style.  It uses "foo(param)".

This sort of thing is normal, though; I've had to style-police almost
every change to the ra_svn code, and I know that ra_dav has experienced
a lot of stylistic inconsistencies.

The situation would be a little bit better if we were less laissez-faire
about code style between files; at least then the people heavily
involved in the project wouldn't accidentally apply one file's style to
another file.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] python 2.1 support (build/generator/gen_base.py)

Posted by "C. Michael Pilato" <cm...@collab.net>.
Martin Furter <mf...@rola.ch> writes:

> On 5 Oct 2003, C. Michael Pilato wrote:
> 
> > This patch looks semantically fine, but (and I really shouldn't have
> > to point out stuff like this -- I mean, doesn't everyone take some
> > degree of pride in making their code *look* good?) this module doesn't
> > use the "foo( param )" coding style.  It uses "foo(param)".
> 
> mf: ERROR: too many coding styles ;-)
> I'm sorry, didn't see that.
> 
> So here's the patch again:

Committed in revision 7310.  Thanks, Martin, for the patch^2+log.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] python 2.1 support (build/generator/gen_base.py)

Posted by Martin Furter <mf...@rola.ch>.

On 5 Oct 2003, C. Michael Pilato wrote:

> This patch looks semantically fine, but (and I really shouldn't have
> to point out stuff like this -- I mean, doesn't everyone take some
> degree of pride in making their code *look* good?) this module doesn't
> use the "foo( param )" coding style.  It uses "foo(param)".

mf: ERROR: too many coding styles ;-)
I'm sorry, didn't see that.

So here's the patch again:

Index: build/generator/gen_base.py
===================================================================
--- build/generator/gen_base.py (revision 7308)
+++ build/generator/gen_base.py (working copy)
@@ -95,7 +95,7 @@
     """Return a list of section objects from a string of section
names."""
     sections = [ ]
     for section_name in string.split(section_list):
-      if section_name not in self.skip_sections:
+      if not self.skip_sections.has_key(section_name):
         sections.append(self.sections[section_name])
     return sections
 

and the missing log message:

Solve the python 2.1 incompatibility introduced in rev 7295.

* build/generator/gen_base.py
  (Generator.find_sections): 
    use 'x.has_key(y)' instead of 'y in x'


Thanks
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] python 2.1 support (build/generator/gen_base.py)

Posted by "C. Michael Pilato" <cm...@collab.net>.
Martin Furter <mf...@rola.ch> writes:

> Today i wanted to update svn and got an error in
> build/generator/gen_base.py:
> TypeError: 'in' or 'not in' needs sequence right argument
> ERROR: gen-make.py failed
> 
> Here's a patch:
> 
> Index: build/generator/gen_base.py
> ===================================================================
> --- build/generator/gen_base.py (revision 7308)
> +++ build/generator/gen_base.py (working copy)
> @@ -95,7 +95,7 @@
>      """Return a list of section objects from a string of section
> names."""
>      sections = [ ]
>      for section_name in string.split(section_list):
> -      if section_name not in self.skip_sections:
> +      if not self.skip_sections.has_key( section_name ):
>          sections.append(self.sections[section_name])
>      return sections

This patch looks semantically fine, but (and I really shouldn't have
to point out stuff like this -- I mean, doesn't everyone take some
degree of pride in making their code *look* good?) this module doesn't
use the "foo( param )" coding style.  It uses "foo(param)".

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org