From 3077fd1d18cea56ce1fad4385f52c96ebe5bf194 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 24 Nov 2010 23:06:40 -0500 Subject: [PATCH] pychecker cleanup. --- Makefile | 7 ++++--- rcs-fast-import | 16 ++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index f353d48..01a16e6 100644 --- a/Makefile +++ b/Makefile @@ -24,9 +24,10 @@ rcs-fast-import-$(VERS).tar.gz: $(SOURCES) rcs-fast-import.1 @(cd ..; rm rcs-fast-import-$(VERS)) pychecker: - ln -f rcs-fast-import rcs-fast-import.py - pychecker --only --limit 50 rcs-fast-import.py - rm -f rcs-fast-import.py + @echo "Expect four messages about unknown methods checkin and maketag." + @ln -f rcs-fast-import rcs-fast-import.py + @-pychecker --quiet --only --limit 50 rcs-fast-import.py + @rm -f rcs-fast-import.py rcs-fast-import.pyc version: @echo $(VERS) diff --git a/rcs-fast-import b/rcs-fast-import index 3e42b53..369625f 100755 --- a/rcs-fast-import +++ b/rcs-fast-import @@ -73,10 +73,10 @@ class Baton: self.stream.flush() self.count = self.count + 1 return - def __exit__(self, type, value, traceback): - if type == KeyboardInterrupt: + def __exit__(self, extype, value_unused, traceback_unused): + if extype == KeyboardInterrupt: self.endmsg = "interrupted" - if type == FatalException: + if extype == FatalException: self.endmsg = "aborted by error" if self.stream: self.stream.write("...(%2.2f sec) %s.\n" \ @@ -278,7 +278,7 @@ class Repository: # __enter and __exit__ added for rcs-fast-import def __enter__(self): return self - def __exit__(self, type, value, traceback): + def __exit__(self, type_unused, value_unused, traceback_unused): self.cleanup() def cleanup(self): nuke(self.subdir(), "rcs-fast-import: cleaning up %s" % self.subdir()) @@ -530,14 +530,14 @@ class Repository: def __setitem__(self, i, v): self.events[i] = v -def sanecheck(event, path, mode): +def sanecheck(event_unused, path, mode): "Sanity-check an operation to see if we can cope." if mode == "160000": - raise FatalException("cannot import submodule link %s", path) + raise FatalException("cannot import submodule link %s" % path) elif mode == "120000": - raise FatalException("cannot import a symlink %s", path) + raise FatalException("cannot import a symlink %s"% path) if not mode[-3:] in ('644', '755'): - raise FatalException("unknown mode %s on %s", (mode, path)) + raise FatalException("unknown mode %s on %s" % (mode, path)) def complain(msg): print >>sys.stderr, "rcs-fast-import:", msg -- 2.43.0