diff -r d2867c430333 Lib/asynchat.py --- a/Lib/asynchat.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/asynchat.py Sat Jan 05 18:00:16 2013 +0200 @@ -214,7 +214,7 @@ # cannot use the old predicate, it violates the claim of the # set_terminator method. - # return (len(self.ac_in_buffer) <= self.ac_in_buffer_size) + # return len(self.ac_in_buffer) <= self.ac_in_buffer_size return 1 def writable (self): diff -r d2867c430333 Lib/bdb.py --- a/Lib/bdb.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/bdb.py Sat Jan 05 18:00:16 2013 +0200 @@ -137,7 +137,7 @@ (bp, flag) = effective(filename, lineno, frame) if bp: self.currentbp = bp.number - if (flag and bp.temporary): + if flag and bp.temporary: self.do_clear(str(bp.number)) return True else: diff -r d2867c430333 Lib/decimal.py --- a/Lib/decimal.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/decimal.py Sat Jan 05 18:00:16 2013 +0200 @@ -928,7 +928,7 @@ other = _convert_other(other, raiseit=True) # Compare(NaN, NaN) = NaN - if (self._is_special or other and other._is_special): + if self._is_special or other and other._is_special: ans = self._check_nans(other, context) if ans: return ans diff -r d2867c430333 Lib/difflib.py --- a/Lib/difflib.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/difflib.py Sat Jan 05 18:00:16 2013 +0200 @@ -1532,10 +1532,10 @@ continue # Catch up on the blank lines so when we yield the next from/to # pair, they are lined up. - while(num_blanks_to_yield < 0): + while num_blanks_to_yield < 0: num_blanks_to_yield += 1 yield None,('','\n'),True - while(num_blanks_to_yield > 0): + while num_blanks_to_yield > 0: num_blanks_to_yield -= 1 yield ('','\n'),None,True if s.startswith('X'): @@ -1560,7 +1560,7 @@ fromlines,tolines=[],[] while True: # Collecting lines of text until we have a from/to pair - while (len(fromlines)==0 or len(tolines)==0): + while not (fromlines and tolines): from_line, to_line, found_diff = next(line_iterator) if from_line is not None: fromlines.append((from_line,found_diff)) @@ -1588,7 +1588,7 @@ # we need for context. index, contextLines = 0, [None]*(context) found_diff = False - while(found_diff is False): + while found_diff is False: from_line, to_line, found_diff = next(line_pair_iterator) i = index % context contextLines[i] = (from_line, to_line, found_diff) @@ -1601,14 +1601,14 @@ else: lines_to_write = index index = 0 - while(lines_to_write): + while lines_to_write: i = index % context index += 1 yield contextLines[i] lines_to_write -= 1 # Now yield the context lines after the change lines_to_write = context-1 - while(lines_to_write): + while lines_to_write: from_line, to_line, found_diff = next(line_pair_iterator) # If another change within the context, extend the context if found_diff: diff -r d2867c430333 Lib/idlelib/AutoCompleteWindow.py --- a/Lib/idlelib/AutoCompleteWindow.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/idlelib/AutoCompleteWindow.py Sat Jan 05 18:00:16 2013 +0200 @@ -336,7 +336,7 @@ self._change_start(self.completions[newsel]) return "break" - elif (keysym == "Tab" and not state): + elif keysym == "Tab" and not state: if self.lastkey_was_tab: # two tabs in a row; insert current selection and close acw cursel = int(self.listbox.curselection()[0]) diff -r d2867c430333 Lib/idlelib/PyShell.py --- a/Lib/idlelib/PyShell.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/idlelib/PyShell.py Sat Jan 05 18:00:16 2013 +0200 @@ -1054,7 +1054,7 @@ return "break" self.endoffile = 0 self.canceled = 1 - if (self.executing and self.interp.rpcclt): + if self.executing and self.interp.rpcclt: if self.interp.getdebugger(): self.interp.restart_subprocess() else: diff -r d2867c430333 Lib/logging/__init__.py --- a/Lib/logging/__init__.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/logging/__init__.py Sat Jan 05 18:00:16 2013 +0200 @@ -1446,7 +1446,7 @@ c = None #break out else: c = c.parent - if (found == 0): + if found == 0: if lastResort: if record.levelno >= lastResort.level: lastResort.handle(record) diff -r d2867c430333 Lib/logging/handlers.py --- a/Lib/logging/handlers.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/logging/handlers.py Sat Jan 05 18:00:16 2013 +0200 @@ -1054,7 +1054,7 @@ url = self.url data = urllib.parse.urlencode(self.mapLogRecord(record)) if self.method == "GET": - if (url.find('?') >= 0): + if url.find('?') >= 0: sep = '&' else: sep = '?' diff -r d2867c430333 Lib/platform.py --- a/Lib/platform.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/platform.py Sat Jan 05 18:00:16 2013 +0200 @@ -1214,7 +1214,7 @@ pass else: csid, cpu_number = vms_lib.getsyi('SYI$_CPU',0) - if (cpu_number >= 128): + if cpu_number >= 128: processor = 'Alpha' else: processor = 'VAX' diff -r d2867c430333 Lib/pty.py --- a/Lib/pty.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/pty.py Sat Jan 05 18:00:16 2013 +0200 @@ -115,7 +115,7 @@ os.dup2(slave_fd, STDIN_FILENO) os.dup2(slave_fd, STDOUT_FILENO) os.dup2(slave_fd, STDERR_FILENO) - if (slave_fd > STDERR_FILENO): + if slave_fd > STDERR_FILENO: os.close (slave_fd) # Explicitly open the tty to make it become a controlling tty. diff -r d2867c430333 Lib/ssl.py --- a/Lib/ssl.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/ssl.py Sat Jan 05 18:00:16 2013 +0200 @@ -367,7 +367,7 @@ self.__class__) amount = len(data) count = 0 - while (count < amount): + while count < amount: v = self.send(data[count:]) count += v return amount @@ -557,7 +557,7 @@ If 'ssl_version' is specified, use it in the connection attempt.""" host, port = addr - if (ca_certs is not None): + if ca_certs is not None: cert_reqs = CERT_REQUIRED else: cert_reqs = CERT_NONE diff -r d2867c430333 Lib/test/test_fractions.py --- a/Lib/test/test_fractions.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_fractions.py Sat Jan 05 18:00:16 2013 +0200 @@ -61,16 +61,16 @@ return NotImplemented def __lt__(self, other): - return(self.num * other._denominator < self.den * other._numerator) + return self.num * other._denominator < self.den * other._numerator def __gt__(self, other): - return(self.num * other._denominator > self.den * other._numerator) + return self.num * other._denominator > self.den * other._numerator def __le__(self, other): - return(self.num * other._denominator <= self.den * other._numerator) + return self.num * other._denominator <= self.den * other._numerator def __ge__(self, other): - return(self.num * other._denominator >= self.den * other._numerator) + return self.num * other._denominator >= self.den * other._numerator # this class is for testing comparisons; conversion to float # should never be used for a comparison, since it loses accuracy diff -r d2867c430333 Lib/test/test_os.py --- a/Lib/test/test_os.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_os.py Sat Jan 05 18:00:16 2013 +0200 @@ -596,7 +596,7 @@ os.chmod(support.TESTFN, existing_testfn_mode | S_ISGID) except OSError: raise unittest.SkipTest('Cannot set S_ISGID for dir.') - if (os.lstat(support.TESTFN).st_mode & S_ISGID != S_ISGID): + if os.lstat(support.TESTFN).st_mode & S_ISGID != S_ISGID: raise unittest.SkipTest('No support for S_ISGID dir mode.') # The os should apply S_ISGID from the parent dir for us, but # this test need not depend on that behavior. Be explicit. diff -r d2867c430333 Lib/test/test_poll.py --- a/Lib/test/test_poll.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_poll.py Sat Jan 05 18:00:16 2013 +0200 @@ -121,7 +121,7 @@ pollster.register( p, select.POLLIN ) for tout in (0, 1000, 2000, 4000, 8000, 16000) + (-1,)*10: fdlist = pollster.poll(tout) - if (fdlist == []): + if fdlist == []: continue fd, flags = fdlist[0] if flags & select.POLLHUP: diff -r d2867c430333 Lib/test/test_signal.py --- a/Lib/test/test_signal.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_signal.py Sat Jan 05 18:00:16 2013 +0200 @@ -379,7 +379,7 @@ if exitcode not in (2, 3): raise Exception("Child error (exit code %s): %s" % (exitcode, stdout)) - return (exitcode == 3) + return exitcode == 3 def test_without_siginterrupt(self): # If a signal handler is installed and siginterrupt is not called diff -r d2867c430333 Lib/test/test_telnetlib.py --- a/Lib/test/test_telnetlib.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_telnetlib.py Sat Jan 05 18:00:16 2013 +0200 @@ -96,7 +96,7 @@ raise NotImplementedError() def close(self): pass def sock_avail(self): - return (not self.sock.block) + return not self.sock.block def msg(self, msg, *args): with support.captured_stdout() as out: telnetlib.Telnet.msg(self, msg, *args) diff -r d2867c430333 Lib/test/test_tempfile.py --- a/Lib/test/test_tempfile.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/test/test_tempfile.py Sat Jan 05 18:00:16 2013 +0200 @@ -498,7 +498,7 @@ extant[i] = self.do_create(pre="aa") finally: for i in extant: - if(isinstance(i, str)): + if isinstance(i, str): os.rmdir(i) def test_choose_directory(self): diff -r d2867c430333 Lib/turtle.py --- a/Lib/turtle.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/turtle.py Sat Jan 05 18:00:16 2013 +0200 @@ -945,7 +945,7 @@ else: self.buffer[self.ptr] = [None] self.ptr = (self.ptr - 1) % self.bufsize - return (item) + return item def nr_of_items(self): return self.bufsize - self.buffer.count([None]) def __repr__(self): diff -r d2867c430333 Lib/webbrowser.py --- a/Lib/webbrowser.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/webbrowser.py Sat Jan 05 18:00:16 2013 +0200 @@ -197,7 +197,7 @@ if not setsid: setsid = getattr(os, 'setpgrp', None) p = subprocess.Popen(cmdline, close_fds=True, preexec_fn=setsid) - return (p.poll() is None) + return p.poll() is None except OSError: return False @@ -385,7 +385,7 @@ except OSError: return False else: - return (p.poll() is None) + return p.poll() is None class Grail(BaseBrowser): diff -r d2867c430333 Tools/pynche/StripViewer.py --- a/Tools/pynche/StripViewer.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Tools/pynche/StripViewer.py Sat Jan 05 18:00:16 2013 +0200 @@ -247,7 +247,7 @@ color = self.__chips[chip[0]-1] red, green, blue = ColorDB.rrggbb_to_triplet(color) etype = int(event.type) - if (etype == BTNUP or self.__uwd.get()): + if etype == BTNUP or self.__uwd.get(): # update everyone self.__sb.update_views(red, green, blue) else: diff -r d2867c430333 Tools/scripts/texi2html.py --- a/Tools/scripts/texi2html.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Tools/scripts/texi2html.py Sat Jan 05 18:00:16 2013 +0200 @@ -1078,7 +1078,7 @@ # --- Sectioning commands --- def popstack(self, type): - if (self.node): + if self.node: self.node.type = type while self.nodestack: if self.nodestack[-1].type > type: