diff -r 0f24c65fb7e5 Lib/asynchat.py --- a/Lib/asynchat.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/asynchat.py Sat Jan 05 18:00:46 2013 +0200 @@ -194,7 +194,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 0f24c65fb7e5 Lib/bdb.py --- a/Lib/bdb.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/bdb.py Sat Jan 05 18:00:46 2013 +0200 @@ -139,7 +139,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 0f24c65fb7e5 Lib/decimal.py --- a/Lib/decimal.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/decimal.py Sat Jan 05 18:00:46 2013 +0200 @@ -925,7 +925,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 0f24c65fb7e5 Lib/difflib.py --- a/Lib/difflib.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/difflib.py Sat Jan 05 18:00:46 2013 +0200 @@ -1527,10 +1527,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'): @@ -1555,7 +1555,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 =line_iterator.next() if from_line is not None: fromlines.append((from_line,found_diff)) @@ -1583,7 +1583,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 = line_pair_iterator.next() i = index % context contextLines[i] = (from_line, to_line, found_diff) @@ -1596,14 +1596,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 = line_pair_iterator.next() # If another change within the context, extend the context if found_diff: diff -r 0f24c65fb7e5 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:46 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 0f24c65fb7e5 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:46 2013 +0200 @@ -1075,7 +1075,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 0f24c65fb7e5 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:46 2013 +0200 @@ -1061,7 +1061,7 @@ url = self.url data = urllib.urlencode(self.mapLogRecord(record)) if self.method == "GET": - if (url.find('?') >= 0): + if url.find('?') >= 0: sep = '&' else: sep = '?' diff -r 0f24c65fb7e5 Lib/platform.py --- a/Lib/platform.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/platform.py Sat Jan 05 18:00:46 2013 +0200 @@ -1268,7 +1268,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 0f24c65fb7e5 Lib/pty.py --- a/Lib/pty.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/pty.py Sat Jan 05 18:00:46 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 0f24c65fb7e5 Lib/ssl.py --- a/Lib/ssl.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/ssl.py Sat Jan 05 18:00:46 2013 +0200 @@ -225,7 +225,7 @@ self.__class__) amount = len(data) count = 0 - while (count < amount): + while count < amount: v = self.send(data[count:]) count += v return amount @@ -435,7 +435,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 0f24c65fb7e5 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:46 2013 +0200 @@ -69,16 +69,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 0f24c65fb7e5 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:46 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 0f24c65fb7e5 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:46 2013 +0200 @@ -485,7 +485,7 @@ extant[i] = self.do_create(pre="aa") finally: for i in extant: - if(isinstance(i, basestring)): + if isinstance(i, basestring): os.rmdir(i) def test_choose_directory(self): diff -r 0f24c65fb7e5 Lib/webbrowser.py --- a/Lib/webbrowser.py Sat Jan 05 07:37:47 2013 +0200 +++ b/Lib/webbrowser.py Sat Jan 05 18:00:46 2013 +0200 @@ -196,7 +196,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 @@ -383,7 +383,7 @@ except OSError: return False else: - return (p.poll() is None) + return p.poll() is None class Grail(BaseBrowser): diff -r 0f24c65fb7e5 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:46 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 0f24c65fb7e5 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:46 2013 +0200 @@ -1079,7 +1079,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: