PyChecker updates.

This commit is contained in:
Jeremy Fincher 2004-08-10 22:09:23 +00:00
parent 3f5cac26b8
commit 6bd8d43c28
2 changed files with 3 additions and 11 deletions

View File

@ -41,14 +41,7 @@ __revision__ = "$Id$"
import supybot.fix as fix
import re
import copy
import sets
import time
import random
import socket
import string
import fnmatch
import operator
import textwrap
from itertools import imap
from cStringIO import StringIO as sio
@ -216,7 +209,6 @@ def separateModes(args):
assert modes[0] in '+-', 'Invalid args: %r' % args
args = list(args[1:])
ret = []
length = len(modes)
for c in modes:
if c in '+-':
last = c

View File

@ -403,7 +403,8 @@ def sortBy(f, L):
def sorted(iterable, cmp=None, key=None, reversed=False):
L = list(iterable)
if key is not None:
sortBy(key, L, cmp=cmp)
assert cmp is not None, 'Can\'t use both cmp and key.'
sortBy(key, L)
else:
L.sort(cmp)
if reversed:
@ -568,7 +569,6 @@ def getSocket(host):
else:
raise socket.error, 'Something wonky happened.'
_ipchars = string.digits + '.'
def isIP(s):
"""Returns whether or not a given string is an IPV4 address.
@ -726,7 +726,7 @@ def transactionalFile(*args, **kwargs):
return AtomicFile(*args, **kwargs)
if __name__ == '__main__':
import sys, doctest
import doctest
doctest.testmod(sys.modules['__main__'])