Re: [gentoo-portage-dev] [PATCH] Eliminate basestring/long/_unicode py3 compat

2020-07-15 Thread Zac Medico
On 7/14/20 11:07 PM, Michał Górny wrote:
> Replace basestring and _unicode hacks with str, and long with int.
> 
> Signed-off-by: Michał Górny 
> ---
>  bin/egencache |  7 +--
>  lib/_emerge/BinpkgFetcher.py  |  5 +-
>  lib/_emerge/BlockerCache.py   | 19 ++-
>  lib/_emerge/BlockerDB.py  |  4 +-
>  lib/_emerge/FakeVartree.py| 11 +---
>  lib/_emerge/JobStatusDisplay.py   |  7 +--
>  lib/_emerge/Package.py| 27 -
>  lib/_emerge/Scheduler.py  |  5 +-
>  lib/_emerge/actions.py| 21 +++
>  lib/_emerge/create_world_atom.py  |  8 +--
>  lib/_emerge/depgraph.py   | 15 ++---
>  lib/_emerge/main.py   |  4 +-
>  lib/_emerge/resolver/output.py| 26 -
>  lib/_emerge/resolver/output_helpers.py|  6 +-
>  lib/_emerge/resolver/slot_collision.py|  6 +-
>  lib/portage/__init__.py   | 12 ++--
>  lib/portage/_emirrordist/MirrorDistTask.py|  7 +--
>  lib/portage/_emirrordist/main.py  |  9 +--
>  lib/portage/_sets/base.py |  7 +--
>  lib/portage/cache/flat_hash.py|  5 +-
>  lib/portage/cache/fs_template.py  |  7 +--
>  lib/portage/cache/index/pkg_desc_index.py | 10 +---
>  lib/portage/cache/metadata.py |  8 +--
>  lib/portage/cache/sqlite.py   |  7 +--
>  lib/portage/cache/template.py | 19 ++-
>  lib/portage/cvstree.py|  3 -
>  lib/portage/dbapi/bintree.py  | 55 ---
>  lib/portage/dbapi/porttree.py |  6 +-
>  lib/portage/dbapi/vartree.py  | 33 +--
>  lib/portage/dep/__init__.py   | 50 +++--
>  lib/portage/eclass_cache.py   | 10 +---
>  lib/portage/elog/__init__.py  |  5 +-
>  lib/portage/elog/mod_echo.py  |  5 +-
>  lib/portage/elog/mod_syslog.py|  5 +-
>  lib/portage/emaint/modules/binhost/binhost.py |  9 +--
>  lib/portage/emaint/modules/sync/sync.py   |  9 +--
>  lib/portage/exception.py  |  9 +--
>  lib/portage/getbinpkg.py  |  5 +-
>  lib/portage/locks.py  | 17 +++---
>  lib/portage/mail.py   |  7 +--
>  lib/portage/manifest.py   | 12 +---
>  lib/portage/package/ebuild/config.py  | 11 ++--
>  lib/portage/package/ebuild/doebuild.py|  8 +--
>  .../package/ebuild/getmaskingstatus.py|  7 +--
>  lib/portage/process.py|  5 +-
>  lib/portage/proxy/lazyimport.py   |  7 +--
>  lib/portage/repository/config.py  |  5 +-
>  lib/portage/sync/getaddrinfo_validate.py  |  6 +-
>  lib/portage/sync/modules/rsync/rsync.py   |  7 +--
>  lib/portage/tests/dep/test_match_from_list.py |  7 +--
>  .../tests/resolver/ResolverPlayground.py  |  9 +--
>  .../tests/unicode/test_string_format.py   |  7 +--
>  lib/portage/update.py | 16 ++
>  lib/portage/util/__init__.py  |  8 +--
>  lib/portage/util/_dyn_libs/LinkageMapELF.py   |  6 +-
>  .../util/_dyn_libs/PreservedLibsRegistry.py   |  7 +--
>  lib/portage/util/_urlopen.py  |  9 +--
>  lib/portage/util/changelog.py | 10 ++--
>  lib/portage/util/compression_probe.py |  4 +-
>  lib/portage/util/configparser.py  |  9 +--
>  lib/portage/util/env_update.py|  7 +--
>  lib/portage/util/install_mask.py  |  9 +--
>  lib/portage/versions.py   | 17 ++
>  lib/portage/xml/metadata.py   | 12 ++--
>  repoman/lib/repoman/__init__.py   |  7 +--
>  repoman/lib/repoman/main.py   |  2 -
>  repoman/lib/repoman/metadata.py   |  5 --
>  .../modules/scan/metadata/ebuild_metadata.py  |  5 +-
>  repoman/lib/repoman/utilities.py  |  3 -
>  69 files changed, 227 insertions(+), 490 deletions(-)

Looks good. Please merge.
-- 
Thanks,
Zac



signature.asc
Description: OpenPGP digital signature


[gentoo-portage-dev] [PATCH] Eliminate basestring/long/_unicode py3 compat

2020-07-14 Thread Michał Górny
Replace basestring and _unicode hacks with str, and long with int.

Signed-off-by: Michał Górny 
---
 bin/egencache |  7 +--
 lib/_emerge/BinpkgFetcher.py  |  5 +-
 lib/_emerge/BlockerCache.py   | 19 ++-
 lib/_emerge/BlockerDB.py  |  4 +-
 lib/_emerge/FakeVartree.py| 11 +---
 lib/_emerge/JobStatusDisplay.py   |  7 +--
 lib/_emerge/Package.py| 27 -
 lib/_emerge/Scheduler.py  |  5 +-
 lib/_emerge/actions.py| 21 +++
 lib/_emerge/create_world_atom.py  |  8 +--
 lib/_emerge/depgraph.py   | 15 ++---
 lib/_emerge/main.py   |  4 +-
 lib/_emerge/resolver/output.py| 26 -
 lib/_emerge/resolver/output_helpers.py|  6 +-
 lib/_emerge/resolver/slot_collision.py|  6 +-
 lib/portage/__init__.py   | 12 ++--
 lib/portage/_emirrordist/MirrorDistTask.py|  7 +--
 lib/portage/_emirrordist/main.py  |  9 +--
 lib/portage/_sets/base.py |  7 +--
 lib/portage/cache/flat_hash.py|  5 +-
 lib/portage/cache/fs_template.py  |  7 +--
 lib/portage/cache/index/pkg_desc_index.py | 10 +---
 lib/portage/cache/metadata.py |  8 +--
 lib/portage/cache/sqlite.py   |  7 +--
 lib/portage/cache/template.py | 19 ++-
 lib/portage/cvstree.py|  3 -
 lib/portage/dbapi/bintree.py  | 55 ---
 lib/portage/dbapi/porttree.py |  6 +-
 lib/portage/dbapi/vartree.py  | 33 +--
 lib/portage/dep/__init__.py   | 50 +++--
 lib/portage/eclass_cache.py   | 10 +---
 lib/portage/elog/__init__.py  |  5 +-
 lib/portage/elog/mod_echo.py  |  5 +-
 lib/portage/elog/mod_syslog.py|  5 +-
 lib/portage/emaint/modules/binhost/binhost.py |  9 +--
 lib/portage/emaint/modules/sync/sync.py   |  9 +--
 lib/portage/exception.py  |  9 +--
 lib/portage/getbinpkg.py  |  5 +-
 lib/portage/locks.py  | 17 +++---
 lib/portage/mail.py   |  7 +--
 lib/portage/manifest.py   | 12 +---
 lib/portage/package/ebuild/config.py  | 11 ++--
 lib/portage/package/ebuild/doebuild.py|  8 +--
 .../package/ebuild/getmaskingstatus.py|  7 +--
 lib/portage/process.py|  5 +-
 lib/portage/proxy/lazyimport.py   |  7 +--
 lib/portage/repository/config.py  |  5 +-
 lib/portage/sync/getaddrinfo_validate.py  |  6 +-
 lib/portage/sync/modules/rsync/rsync.py   |  7 +--
 lib/portage/tests/dep/test_match_from_list.py |  7 +--
 .../tests/resolver/ResolverPlayground.py  |  9 +--
 .../tests/unicode/test_string_format.py   |  7 +--
 lib/portage/update.py | 16 ++
 lib/portage/util/__init__.py  |  8 +--
 lib/portage/util/_dyn_libs/LinkageMapELF.py   |  6 +-
 .../util/_dyn_libs/PreservedLibsRegistry.py   |  7 +--
 lib/portage/util/_urlopen.py  |  9 +--
 lib/portage/util/changelog.py | 10 ++--
 lib/portage/util/compression_probe.py |  4 +-
 lib/portage/util/configparser.py  |  9 +--
 lib/portage/util/env_update.py|  7 +--
 lib/portage/util/install_mask.py  |  9 +--
 lib/portage/versions.py   | 17 ++
 lib/portage/xml/metadata.py   | 12 ++--
 repoman/lib/repoman/__init__.py   |  7 +--
 repoman/lib/repoman/main.py   |  2 -
 repoman/lib/repoman/metadata.py   |  5 --
 .../modules/scan/metadata/ebuild_metadata.py  |  5 +-
 repoman/lib/repoman/utilities.py  |  3 -
 69 files changed, 227 insertions(+), 490 deletions(-)

diff --git a/bin/egencache b/bin/egencache
index d172319f8..0847d73a7 100755
--- a/bin/egencache
+++ b/bin/egencache
@@ -75,9 +75,6 @@ else:
else:
from portage.xml.metadata import parse_metadata_use
 
-if sys.hexversion >= 0x300:
-   # pylint: disable=W0622
-   long = int
 
 def parse_args(args):
usage = "egencache [options]  ... [atom] ..."
@@ -344,7 +341,7 @@ class GenCache(object):
max_mtime = ec_hash.mtime
if max_mtime == sc.mtime:
max_mtime += 1
-   max_mtime = long(max_mtime)
+   max_mtime = int(max_mtime)
try:
os.utime(ebuild_hash.location, 
(max_mtime, max_mtime))
except OSError as e