Gentoo Archives: gentoo-catalyst

From: Mike Frysinger <vapier@g.o>
To: gentoo-catalyst@l.g.o
Subject: [gentoo-catalyst] [PATCH 13/13] lint: clean up superfluous parens
Date: Tue, 06 Oct 2015 15:06:22
Message-Id: 1444143929-26705-13-git-send-email-vapier@gentoo.org
In Reply to: [gentoo-catalyst] [PATCH 01/13] lint: fix duplicate fcntl import by Mike Frysinger
1 These don't need the parens, so omit them.
2
3 In the case of setup.py, we were expecting a print function, not a
4 keyword, so make sure to import that module.
5 ---
6 catalyst/lock.py | 6 +++---
7 doc/make_subarch_table_guidexml.py | 6 +++---
8 setup.py | 1 +
9 3 files changed, 7 insertions(+), 6 deletions(-)
10
11 diff --git a/catalyst/lock.py b/catalyst/lock.py
12 index d079b2d..3d50c06 100644
13 --- a/catalyst/lock.py
14 +++ b/catalyst/lock.py
15 @@ -179,7 +179,7 @@ class LockDir(object):
16 if not os.path.exists(self.lockfile):
17 print "lockfile does not exist '%s'" % self.lockfile
18 #print "fcntl_unlock() , self.myfd:", self.myfd, type(self.myfd)
19 - if (self.myfd != None):
20 + if self.myfd != None:
21 #print "fcntl_unlock() trying to close it "
22 try:
23 os.close(self.myfd)
24 @@ -236,7 +236,7 @@ class LockDir(object):
25 #if type(lockfilename) == types.StringType:
26 # os.close(myfd)
27 #print "fcntl_unlock() trying a last ditch close", self.myfd
28 - if (self.myfd != None):
29 + if self.myfd != None:
30 os.close(self.myfd)
31 self.myfd=None
32 self.locked=False
33 @@ -256,7 +256,7 @@ class LockDir(object):
34 start_time = time.time()
35 reported_waiting = False
36
37 - while(time.time() < (start_time + max_wait)):
38 + while time.time() < (start_time + max_wait):
39 # We only need it to exist.
40 self.myfd = os.open(self.myhardlock, os.O_CREAT|os.O_RDWR,0660)
41 os.close(self.myfd)
42 diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py
43 index 54e0a4a..a6a9022 100755
44 --- a/doc/make_subarch_table_guidexml.py
45 +++ b/doc/make_subarch_table_guidexml.py
46 @@ -30,7 +30,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
47 # Apply alias grouping
48 arch = _pattern_arch_genericliases.get(arch, arch)
49
50 - assert(subarch not in subarch_id_to_pattern_arch_genericrch_id)
51 + assert subarch not in subarch_id_to_pattern_arch_genericrch_id
52 subarch_id_to_pattern_arch_genericrch_id[subarch] = arch
53
54 return
55 @@ -40,7 +40,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
56 child_subarch = x.group(1)
57 parent_subarch = x.group(2)
58
59 - assert(child_subarch not in subarch_id_to_pattern_arch_genericrch_id)
60 + assert child_subarch not in subarch_id_to_pattern_arch_genericrch_id
61 subarch_id_to_pattern_arch_genericrch_id[child_subarch] = subarch_id_to_pattern_arch_genericrch_id[parent_subarch]
62
63 return
64 @@ -49,7 +49,7 @@ def handle_line(line, subarch_title_to_subarch_id, subarch_id_to_pattern_arch_ge
65 subarch_title = x.group(1)
66 subarch_id = x.group(2)
67
68 - assert(subarch_title not in subarch_title_to_subarch_id)
69 + assert subarch_title not in subarch_title_to_subarch_id
70 subarch_title_to_subarch_id[subarch_title] = subarch_id
71
72
73 diff --git a/setup.py b/setup.py
74 index e4569ee..a875db1 100755
75 --- a/setup.py
76 +++ b/setup.py
77 @@ -1,5 +1,6 @@
78 """Catalyst is a release building tool used by Gentoo Linux"""
79
80 +from __future__ import print_function
81
82 import codecs as _codecs
83 from distutils.core import setup as _setup, Command as _Command
84 --
85 2.5.2

Replies