# HG changeset patch # User mark.williamson@cl.cam.ac.uk # Date 1121040071 28800 # Node ID 31a9aa890016063d480e5e28d8e3e391016d93b5 # Parent 0100a43788cad286ab4b0cad64111bd975765ac2 A number of minor fixes to problems that pychecker found. # HG changeset patch # User mark.williamson@cl.cam.ac.uk # Node ID 55d38977b7f2e73b8c1090179928ac96c8922b90 # Parent b3bba126b04ab2f24274a1bcf5a224c6317c8e0d A number of minor fixes to problems that pychecker found. diff --git a/mercurial/byterange.py b/mercurial/byterange.py --- a/mercurial/byterange.py +++ b/mercurial/byterange.py @@ -219,7 +219,7 @@ class FileRangeHandler(urllib2.FileHandl if host: host, port = urllib.splitport(host) if port or socket.gethostbyname(host) not in self.get_names(): - raise URLError('file not on local host') + raise urllib2.URLError('file not on local host') fo = open(localfile,'rb') brange = req.headers.get('Range',None) brange = range_header_to_tuple(brange) @@ -249,7 +249,6 @@ from urllib import splitport, splituser, import ftplib import socket import sys -import ftplib import mimetypes import mimetools @@ -275,7 +274,7 @@ class FTPRangeHandler(urllib2.FTPHandler try: host = socket.gethostbyname(host) except socket.error, msg: - raise URLError(msg) + raise urllib2.URLError(msg) path, attrs = splitattr(req.get_selector()) dirs = path.split('/') dirs = map(unquote, dirs) diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -897,7 +897,7 @@ def serve(ui, repo, **opts): if not d: break fout.write(d) - out.flush() + fout.flush() elif cmd == "addchangegroup": if not lock: diff --git a/mercurial/fancyopts.py b/mercurial/fancyopts.py --- a/mercurial/fancyopts.py +++ b/mercurial/fancyopts.py @@ -1,4 +1,4 @@ -import os, getopt +import getopt def fancyopts(args, options, state): long=[] diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -764,7 +764,7 @@ class localrepository: mf1[f] = util.is_exec(self.wjoin(f), mf1.get(f, False)) t = self.wfile(f).read() except IOError: - self.warn("trouble committing %s!\n" % f) + self.ui.warn("trouble committing %s!\n" % f) raise meta = {} diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -25,7 +25,7 @@ def explain_exit(code): val = os.WTERMSIG(code) return "killed by signal %d" % val, val elif os.WIFSTOPPED(code): - val = os.STOPSIG(code) + val = os.WSTOPSIG(code) return "stopped by signal %d" % val, val raise ValueError("invalid exit code")