summaryrefslogtreecommitdiffstats
path: root/Demo/xml
diff options
context:
space:
mode:
authorCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
committerCollin Winter <collinw@gmail.com>2007-07-17 20:59:35 (GMT)
commit6f2df4d5e193d54244b0c2de91ef0ab1604b9243 (patch)
tree5e172400da7561eb4bb8fafc62c8cab511d74dad /Demo/xml
parenta8c360ee76fb76902a2e2140fbb38d4b06b2d9fb (diff)
downloadcpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.zip
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.gz
cpython-6f2df4d5e193d54244b0c2de91ef0ab1604b9243.tar.bz2
Run 2to3 over the Demo/ directory to shut up parse errors from 2to3 about lingering print statements.
Diffstat (limited to 'Demo/xml')
-rw-r--r--Demo/xml/elem_count.py18
-rw-r--r--Demo/xml/roundtrip.py2
2 files changed, 10 insertions, 10 deletions
diff --git a/Demo/xml/elem_count.py b/Demo/xml/elem_count.py
index 7b53189..a2b4647 100644
--- a/Demo/xml/elem_count.py
+++ b/Demo/xml/elem_count.py
@@ -15,20 +15,20 @@ class FancyCounter(handler.ContentHandler):
self._attrs = self._attrs + len(attrs)
self._elem_types[name] = self._elem_types.get(name, 0) + 1
- for name in attrs.keys():
+ for name in list(attrs.keys()):
self._attr_types[name] = self._attr_types.get(name, 0) + 1
def endDocument(self):
- print "There were", self._elems, "elements."
- print "There were", self._attrs, "attributes."
+ print("There were", self._elems, "elements.")
+ print("There were", self._attrs, "attributes.")
- print "---ELEMENT TYPES"
- for pair in self._elem_types.items():
- print "%20s %d" % pair
+ print("---ELEMENT TYPES")
+ for pair in list(self._elem_types.items()):
+ print("%20s %d" % pair)
- print "---ATTRIBUTE TYPES"
- for pair in self._attr_types.items():
- print "%20s %d" % pair
+ print("---ATTRIBUTE TYPES")
+ for pair in list(self._attr_types.items()):
+ print("%20s %d" % pair)
parser = make_parser()
diff --git a/Demo/xml/roundtrip.py b/Demo/xml/roundtrip.py
index 8d7d437..b0e131e 100644
--- a/Demo/xml/roundtrip.py
+++ b/Demo/xml/roundtrip.py
@@ -22,7 +22,7 @@ class ContentGenerator(handler.ContentHandler):
def startElement(self, name, attrs):
self._out.write('<' + name)
- for (name, value) in attrs.items():
+ for (name, value) in list(attrs.items()):
self._out.write(' %s="%s"' % (name, saxutils.escape(value)))
self._out.write('>')