pkgsrc/textproc/py-HappyDoc/patches/patch-ab
joerg 2dfe63b965 None is a true singleton in Python 2.4 and the parser disallows
any assignments or use as parameter. Rename the parameters as workaround.
2006-06-06 19:26:30 +00:00

70 lines
2.5 KiB
Text

$NetBSD: patch-ab,v 1.1 2006/06/06 19:26:30 joerg Exp $
--- happydoclib/docstring/StructuredText/STDOM.py.orig 2006-06-06 19:20:54.000000000 +0000
+++ happydoclib/docstring/StructuredText/STDOM.py
@@ -171,7 +171,7 @@ class NodeWrapper(ParentNode):
type=type,
st=type(''),
getattr=getattr,
- None=None):
+ My_None=None):
"""
The node immediately preceding this node. If
@@ -180,17 +180,17 @@ class NodeWrapper(ParentNode):
children = self.aq_parent.getChildren()
if not children:
- return None
+ return My_None
- index=getattr(self, '_DOMIndex', None)
- if index is None:
+ index=getattr(self, '_DOMIndex', My_None)
+ if index is My_None:
index=self._getDOMIndex(children)
- if index is None: return None
+ if index is My_None: return My_None
index=index-1
- if index < 0: return None
+ if index < 0: return My_None
try: n=children[index]
- except IndexError: return None
+ except IndexError: return My_None
else:
if type(n) is st:
n=TextNode(n)
@@ -243,9 +243,9 @@ class NodeWrapper(ParentNode):
type=type,
st=type(''),
getattr=getattr,
- None=None):
+ My_None=None):
- return self.getPreviousSibling(type,st,getattr,None)
+ return self.getPreviousSibling(type,st,getattr,My_None)
def _get_NextSibling(self, type=type, st=type('')):
return self.getNextSibling(type,st)
@@ -292,7 +292,7 @@ class Node(ParentNode):
type=type,
st=type(''),
getattr=getattr,
- None=None):
+ My_None=None):
"""
The node immediately preceding this node. If
there is no such node, this returns None.
@@ -346,9 +346,9 @@ class Node(ParentNode):
type=type,
st=type(''),
getattr=getattr,
- None=None):
+ My_None=None):
- return self.getPreviousSibling(type,st,getattr,None)
+ return self.getPreviousSibling(type,st,getattr,My_None)
def _get_NextSibling(self, type=type, st=type('')):
return self.getNextSibling()