public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: lib/portage/dep/, lib/portage/package/ebuild/, lib/portage/, lib/portage/cache/, ...
@ 2022-04-13  3:26 Sam James
  0 siblings, 0 replies; only message in thread
From: Sam James @ 2022-04-13  3:26 UTC (permalink / raw
  To: gentoo-commits

commit:     9e288a776d9668a2f71a83610217edd517fa7079
Author:     Thomas Bracht Laumann Jespersen <t <AT> laumann <DOT> xyz>
AuthorDate: Tue Apr 12 12:39:51 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 03:26:37 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=9e288a77

cleanup: replace '!= None' with 'is not None'

Result from running this:

    find -name '*.py' |xargs sed -i -e 's/!= None/is not None/g'

Same as the previous commit, just figured I'd keep the results in
separate commits.

Signed-off-by: Thomas Bracht Laumann Jespersen <t <AT> laumann.xyz>
Closes: https://github.com/gentoo/portage/pull/812
Signed-off-by: Sam James <sam <AT> gentoo.org>

 lib/_emerge/is_valid_package_atom.py | 2 +-
 lib/portage/_sets/base.py            | 2 +-
 lib/portage/_sets/files.py           | 6 +++---
 lib/portage/cache/anydbm.py          | 2 +-
 lib/portage/cache/mappings.py        | 4 ++--
 lib/portage/cache/sql_template.py    | 6 +++---
 lib/portage/dbapi/vartree.py         | 8 ++++----
 lib/portage/dep/__init__.py          | 2 +-
 lib/portage/dep/dep_check.py         | 2 +-
 lib/portage/mail.py                  | 2 +-
 lib/portage/package/ebuild/fetch.py  | 2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/lib/_emerge/is_valid_package_atom.py b/lib/_emerge/is_valid_package_atom.py
index 004337e25..d05d35e17 100644
--- a/lib/_emerge/is_valid_package_atom.py
+++ b/lib/_emerge/is_valid_package_atom.py
@@ -18,7 +18,7 @@ def insert_category_into_atom(atom, category):
 def is_valid_package_atom(x, allow_repo=False, allow_build_id=True):
     if "/" not in x.split(":")[0]:
         x2 = insert_category_into_atom(x, "cat")
-        if x2 != None:
+        if x2 is not None:
             x = x2
     return isvalidatom(
         x, allow_blockers=False, allow_repo=allow_repo, allow_build_id=allow_build_id

diff --git a/lib/portage/_sets/base.py b/lib/portage/_sets/base.py
index 8e540f3c8..23e8e795e 100644
--- a/lib/portage/_sets/base.py
+++ b/lib/portage/_sets/base.py
@@ -226,7 +226,7 @@ class InternalPackageSet(EditablePackageSet):
         super(InternalPackageSet, self).__init__(
             allow_wildcard=allow_wildcard, allow_repo=allow_repo
         )
-        if initial_atoms != None:
+        if initial_atoms is not None:
             self.update(initial_atoms)
 
     def clear(self):

diff --git a/lib/portage/_sets/files.py b/lib/portage/_sets/files.py
index 4d7f6f1ab..21e6933fa 100644
--- a/lib/portage/_sets/files.py
+++ b/lib/portage/_sets/files.py
@@ -56,18 +56,18 @@ class StaticFileSet(EditablePackageSet):
         value = []
         for line in metadata:
             line = line.strip()
-            if len(line) == 0 and key != None:
+            if len(line) == 0 and key is not None:
                 setattr(self, key, " ".join(value))
                 key = None
             elif line[-1] == ":" and key is None:
                 key = line[:-1].lower()
                 value = []
-            elif key != None:
+            elif key is not None:
                 value.append(line)
             else:
                 pass
         else:
-            if key != None:
+            if key is not None:
                 setattr(self, key, " ".join(value))
 
     def _validate(self, atom):

diff --git a/lib/portage/cache/anydbm.py b/lib/portage/cache/anydbm.py
index 2ab82a9f8..cf5f3fa4b 100644
--- a/lib/portage/cache/anydbm.py
+++ b/lib/portage/cache/anydbm.py
@@ -90,7 +90,7 @@ class database(fs_template.FsBased):
         return cpv in self.__db
 
     def __del__(self):
-        if "__db" in self.__dict__ and self.__db != None:
+        if "__db" in self.__dict__ and self.__db is not None:
             self.__db.sync()
             self.__db.close()
 

diff --git a/lib/portage/cache/mappings.py b/lib/portage/cache/mappings.py
index c0f2147a9..00126cf44 100644
--- a/lib/portage/cache/mappings.py
+++ b/lib/portage/cache/mappings.py
@@ -250,7 +250,7 @@ class LazyLoad(Mapping):
     def __getitem__(self, key):
         if key in self.d:
             return self.d[key]
-        if self.pull != None:
+        if self.pull is not None:
             self.d.update(self.pull())
             self.pull = None
         return self.d[key]
@@ -264,7 +264,7 @@ class LazyLoad(Mapping):
     def __contains__(self, key):
         if key in self.d:
             return True
-        if self.pull != None:
+        if self.pull is not None:
             self.d.update(self.pull())
             self.pull = None
         return key in self.d

diff --git a/lib/portage/cache/sql_template.py b/lib/portage/cache/sql_template.py
index 99cd41a34..f8ce72d5b 100644
--- a/lib/portage/cache/sql_template.py
+++ b/lib/portage/cache/sql_template.py
@@ -152,7 +152,7 @@ class SQLDatabase(template.database):
 
     def __del__(self):
         # just to be safe.
-        if "db" in self.__dict__ and self.db != None:
+        if "db" in self.__dict__ and self.db is not None:
             self.commit()
             self.db.close()
 
@@ -278,7 +278,7 @@ class SQLDatabase(template.database):
         l = []
         for x, y, v in self.con.fetchall():
             if oldcpv != x:
-                if oldcpv != None:
+                if oldcpv is not None:
                     d = dict(l)
                     if "_eclasses_" in d:
                         d["_eclasses_"] = reconstruct_eclasses(oldcpv, d["_eclasses_"])
@@ -288,7 +288,7 @@ class SQLDatabase(template.database):
                 l.clear()
                 oldcpv = x
             l.append((y, v))
-        if oldcpv != None:
+        if oldcpv is not None:
             d = dict(l)
             if "_eclasses_" in d:
                 d["_eclasses_"] = reconstruct_eclasses(oldcpv, d["_eclasses_"])

diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index 190bf8c92..072bc1506 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -5595,7 +5595,7 @@ class dblink:
                         mydest = newdest
 
                 # if secondhand is None it means we're operating in "force" mode and should not create a second hand.
-                if (secondhand != None) and (not os.path.exists(myrealto)):
+                if (secondhand is not None) and (not os.path.exists(myrealto)):
                     # either the target directory doesn't exist yet or the target file doesn't exist -- or
                     # the target is a broken symlink.  We will add this file to our "second hand" and merge
                     # it later.
@@ -5618,7 +5618,7 @@ class dblink:
                 except OSError:
                     pass
 
-                if mymtime != None:
+                if mymtime is not None:
                     # Use lexists, since if the target happens to be a broken
                     # symlink then that should trigger an independent warning.
                     if not (
@@ -5658,7 +5658,7 @@ class dblink:
                     return 1
             elif stat.S_ISDIR(mymode):
                 # we are merging a directory
-                if mydmode != None:
+                if mydmode is not None:
                     # destination exists
 
                     if bsd_chflags:
@@ -5838,7 +5838,7 @@ class dblink:
                     except OSError:
                         pass
 
-                if mymtime != None:
+                if mymtime is not None:
                     outfile.write(
                         self._format_contents_line(
                             node_type="obj",

diff --git a/lib/portage/dep/__init__.py b/lib/portage/dep/__init__.py
index 5ebf95e89..8ae726fed 100644
--- a/lib/portage/dep/__init__.py
+++ b/lib/portage/dep/__init__.py
@@ -2868,7 +2868,7 @@ class _RequiredUseBranch:
 
         complex_nesting = False
         node = self
-        while node != None and not complex_nesting:
+        while node is not None and not complex_nesting:
             if node._operator in ("||", "^^", "??"):
                 complex_nesting = True
             else:

diff --git a/lib/portage/dep/dep_check.py b/lib/portage/dep/dep_check.py
index 9fccda08b..5a82374f3 100644
--- a/lib/portage/dep/dep_check.py
+++ b/lib/portage/dep/dep_check.py
@@ -1080,7 +1080,7 @@ def dep_wordreduce(mydeplist, mysettings, mydbapi, mode, use_cache=1):
                         mydep = x
                 else:
                     mydep = mydbapi.match(deplist[mypos], use_cache=use_cache)
-                if mydep != None:
+                if mydep is not None:
                     tmp = len(mydep) >= 1
                     if deplist[mypos][0] == "!":
                         tmp = False

diff --git a/lib/portage/mail.py b/lib/portage/mail.py
index 82bad6676..40d417808 100644
--- a/lib/portage/mail.py
+++ b/lib/portage/mail.py
@@ -119,7 +119,7 @@ def send_mail(mysettings, message):
     if mymailhost[0] == os.sep and os.path.exists(mymailhost):
         fd = os.popen(f"{mymailhost } -f {myfrom} {myrecipient}", "w")
         fd.write(_force_ascii_if_necessary(message.as_string()))
-        if fd.close() != None:
+        if fd.close() is not None:
             sys.stderr.write(
                 _(
                     f"!!! {mymailhost} returned with a non-zero exit code. This generally indicates an error.\n"

diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
index 2d3625800..76e12dbd6 100644
--- a/lib/portage/package/ebuild/fetch.py
+++ b/lib/portage/package/ebuild/fetch.py
@@ -1961,7 +1961,7 @@ def fetch(
                                 )
                             fetched = 2
                             break
-                        elif mydigests != None:
+                        elif mydigests is not None:
                             writemsg(
                                 _("No digest file available and download failed.\n\n"),
                                 noiselevel=-1,


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-13  3:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-13  3:26 [gentoo-commits] proj/portage:master commit in: lib/portage/dep/, lib/portage/package/ebuild/, lib/portage/, lib/portage/cache/, Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox