summaryrefslogtreecommitdiffstats
path: root/Demo/pdist/rcslib.py
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/pdist/rcslib.py
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/pdist/rcslib.py')
-rwxr-xr-xDemo/pdist/rcslib.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/Demo/pdist/rcslib.py b/Demo/pdist/rcslib.py
index 3e63869..9690f3b 100755
--- a/Demo/pdist/rcslib.py
+++ b/Demo/pdist/rcslib.py
@@ -90,7 +90,7 @@ class RCS:
dict[key] = value
status = self._closepipe(f)
if status:
- raise IOError, status
+ raise IOError(status)
return dict
# --- Methods that change files ---
@@ -160,12 +160,12 @@ class RCS:
def listfiles(self, pat = None):
"""Return a list of all version files matching optional PATTERN."""
files = os.listdir(os.curdir)
- files = filter(self._isrcs, files)
+ files = list(filter(self._isrcs, files))
if os.path.isdir('RCS'):
files2 = os.listdir('RCS')
- files2 = filter(self._isrcs, files2)
+ files2 = list(filter(self._isrcs, files2))
files = files + files2
- files = map(self.realname, files)
+ files = list(map(self.realname, files))
return self._filter(files, pat)
def isvalid(self, name):
@@ -218,7 +218,7 @@ class RCS:
line = f.readline()
status = self._closepipe(f)
if status:
- raise IOError, status
+ raise IOError(status)
if not line: return None
if line[-1] == '\n':
line = line[:-1]
@@ -232,7 +232,7 @@ class RCS:
"""
name, rev = self._unmangle(name_rev)
if not self.isvalid(name):
- raise os.error, 'not an rcs file %r' % (name,)
+ raise os.error('not an rcs file %r' % (name,))
return name, rev
# --- Internal methods ---
@@ -269,7 +269,7 @@ class RCS:
name, rev = name_rev
for c in rev:
if c not in self.okchars:
- raise ValueError, "bad char in rev"
+ raise ValueError("bad char in rev")
return name_rev
def _closepipe(self, f):
@@ -304,7 +304,7 @@ class RCS:
"""
cmd = cmd + " </dev/null"
sts = os.system(cmd)
- if sts: raise IOError, "command exit status %d" % sts
+ if sts: raise IOError("command exit status %d" % sts)
def _filter(self, files, pat = None):
"""INTERNAL: Return a sorted copy of the given list of FILES.
@@ -316,7 +316,7 @@ class RCS:
if pat:
def keep(name, pat = pat):
return fnmatch.fnmatch(name, pat)
- files = filter(keep, files)
+ files = list(filter(keep, files))
else:
files = files[:]
files.sort()