From 283de270987dbd17a3cf2285da60722d4b5cc001 Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 28 Nov 2017 10:32:55 +0200 Subject: [PATCH] Remove redundant parentheses --- lib/_json.py | 2 +- lib/extras.py | 2 +- lib/tz.py | 2 +- scripts/refcounter.py | 4 ++-- tests/test_lobject.py | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/_json.py b/lib/_json.py index 30910eba..71c2b76c 100644 --- a/lib/_json.py +++ b/lib/_json.py @@ -194,7 +194,7 @@ def _get_json_oids(conn_or_curs, name='json'): r = curs.fetchone() # revert the status of the connection as before the command - if (conn_status != STATUS_IN_TRANSACTION and not conn.autocommit): + if conn_status != STATUS_IN_TRANSACTION and not conn.autocommit: conn.rollback() if not r: diff --git a/lib/extras.py b/lib/extras.py index 67e50b29..3308f78f 100644 --- a/lib/extras.py +++ b/lib/extras.py @@ -280,7 +280,7 @@ class RealDictRow(dict): return dict.__setitem__(self, name, value) def __getstate__(self): - return (self.copy(), self._column_mapping[:]) + return self.copy(), self._column_mapping[:] def __setstate__(self, data): self.update(data[0]) diff --git a/lib/tz.py b/lib/tz.py index 92a16041..d593175c 100644 --- a/lib/tz.py +++ b/lib/tz.py @@ -75,7 +75,7 @@ class FixedOffsetTimezone(datetime.tzinfo): def __getinitargs__(self): offset_mins = self._offset.seconds // 60 + self._offset.days * 24 * 60 - return (offset_mins, self._name) + return offset_mins, self._name def utcoffset(self, dt): return self._offset diff --git a/scripts/refcounter.py b/scripts/refcounter.py index 9e900cf7..305dd1bc 100755 --- a/scripts/refcounter.py +++ b/scripts/refcounter.py @@ -43,7 +43,7 @@ def main(): dump(i, opt) f1 = open('debug-%02d.txt' % (opt.nruns - 1)).readlines() - f2 = open('debug-%02d.txt' % (opt.nruns)).readlines() + f2 = open('debug-%02d.txt' % opt.nruns).readlines() for line in difflib.unified_diff(f1, f2, "run %d" % (opt.nruns - 1), "run %d" % opt.nruns): sys.stdout.write(line) @@ -52,7 +52,7 @@ def main(): if opt.objs: f1 = open('objs-%02d.txt' % (opt.nruns - 1)).readlines() - f2 = open('objs-%02d.txt' % (opt.nruns)).readlines() + f2 = open('objs-%02d.txt' % opt.nruns).readlines() for line in difflib.unified_diff(f1, f2, "run %d" % (opt.nruns - 1), "run %d" % opt.nruns): sys.stdout.write(line) diff --git a/tests/test_lobject.py b/tests/test_lobject.py index cf8a556d..8eafabc9 100755 --- a/tests/test_lobject.py +++ b/tests/test_lobject.py @@ -463,9 +463,9 @@ def _has_lo64(conn): % conn.server_version) if 'lo64' not in psycopg2.__version__: - return (False, "this psycopg build doesn't support the lo64 API") + return False, "this psycopg build doesn't support the lo64 API" - return (True, "this server and build support the lo64 API") + return True, "this server and build support the lo64 API" def skip_if_no_lo64(f):