public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Subject: [gentoo-catalyst] [PATCH 13/13] lint: clean up superfluous parens
Date: Tue,  6 Oct 2015 11:05:29 -0400	[thread overview]
Message-ID: <1444143929-26705-13-git-send-email-vapier@gentoo.org> (raw)
In-Reply-To: <1444143929-26705-1-git-send-email-vapier@gentoo.org>

These don't need the parens, so omit them.

In the case of setup.py, we were expecting a print function, not a
keyword, so make sure to import that module.
---
 catalyst/lock.py                   | 6 +++---
 doc/make_subarch_table_guidexml.py | 6 +++---
 setup.py                           | 1 +
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/catalyst/lock.py b/catalyst/lock.py
index d079b2d..3d50c06 100644
--- a/catalyst/lock.py
+++ b/catalyst/lock.py
@@ -179,7 +179,7 @@ class LockDir(object):
 		if not os.path.exists(self.lockfile):
 			print "lockfile does not exist '%s'" % self.lockfile
 			#print "fcntl_unlock() , self.myfd:", self.myfd, type(self.myfd)
-			if (self.myfd != None):
+			if self.myfd != None:
 				#print "fcntl_unlock() trying to close it "
 				try:
 					os.close(self.myfd)
@@ -236,7 +236,7 @@ class LockDir(object):
 					#if type(lockfilename) == types.StringType:
 					#        os.close(myfd)
 		#print "fcntl_unlock() trying a last ditch close", self.myfd
-		if (self.myfd != None):
+		if self.myfd != None:
 			os.close(self.myfd)
 			self.myfd=None
 			self.locked=False
@@ -256,7 +256,7 @@ class LockDir(object):
 		start_time = time.time()
 		reported_waiting = False
 
-		while(time.time() < (start_time + max_wait)):
+		while time.time() < (start_time + max_wait):
 			# We only need it to exist.
 			self.myfd = os.open(self.myhardlock, os.O_CREAT|os.O_RDWR,0660)
 			os.close(self.myfd)
diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py
index 54e0a4a..a6a9022 100755
--- a/doc/make_subarch_table_guidexml.py
+++ b/doc/make_subarch_table_guidexml.py
@@ -30,7 +30,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
 		# Apply alias grouping
 		arch = _pattern_arch_genericliases.get(arch, arch)
 
-		assert(subarch not in subarch_id_to_pattern_arch_genericrch_id)
+		assert subarch not in subarch_id_to_pattern_arch_genericrch_id
 		subarch_id_to_pattern_arch_genericrch_id[subarch] = arch
 
 		return
@@ -40,7 +40,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
 		child_subarch = x.group(1)
 		parent_subarch = x.group(2)
 
-		assert(child_subarch not in subarch_id_to_pattern_arch_genericrch_id)
+		assert child_subarch not in subarch_id_to_pattern_arch_genericrch_id
 		subarch_id_to_pattern_arch_genericrch_id[child_subarch] = subarch_id_to_pattern_arch_genericrch_id[parent_subarch]
 
 		return
@@ -49,7 +49,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
 		subarch_title = x.group(1)
 		subarch_id = x.group(2)
 
-		assert(subarch_title not in subarch_title_to_subarch_id)
+		assert subarch_title not in subarch_title_to_subarch_id
 		subarch_title_to_subarch_id[subarch_title] = subarch_id
 
 
diff --git a/setup.py b/setup.py
index e4569ee..a875db1 100755
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,6 @@
 """Catalyst is a release building tool used by Gentoo Linux"""
 
+from __future__ import print_function
 
 import codecs as _codecs
 from distutils.core import setup as _setup, Command as _Command
-- 
2.5.2



  parent reply	other threads:[~2015-10-06 15:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-06 15:05 [gentoo-catalyst] [PATCH 01/13] lint: fix duplicate fcntl import Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 02/13] lint: unwrap multiple statements Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 03/13] lint: fix bad indentation Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 04/13] lint: convert funcs to @staticmethod where it makes sense Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 05/13] lint: clean up bare exception handling Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 06/13] lint: avoid relative imports Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 07/13] fileops: fix passing of gid/uid/minimal args Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 08/13] lint: revise wildcard import Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 09/13] lint: mark unused func args Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 10/13] lint: init all members in __init__ Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 11/13] version: use the passed in value Mike Frysinger
2015-10-06 15:05 ` [gentoo-catalyst] [PATCH 12/13] targets: fix bad set_build_kernel_vars call Mike Frysinger
2015-10-06 15:05 ` Mike Frysinger [this message]
2015-10-06 15:27   ` [gentoo-catalyst] [PATCH 13/13] lint: clean up superfluous parens Brian Dolbec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444143929-26705-13-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox