* [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/util/, pym/_emerge/resolver/, pym/portage/sync/modules/rsync/, ...
@ 2016-05-31 13:45 Michał Górny
0 siblings, 0 replies; only message in thread
From: Michał Górny @ 2016-05-31 13:45 UTC (permalink / raw
To: gentoo-commits
commit: 9590cb4bf4140e3fc5610b1ea0e290b2df93c24a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue May 24 07:36:34 2016 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue May 31 13:44:08 2016 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=9590cb4b
Remove unneeded native_kwargs wrapper
Remove the native_kwargs wrapper and all uses of it. As pointed out by
Zac Medico, this was only needed for Python < 2.6.5, and we no longer
support those versions for quite some time.
Acked-by: Alexander Berntsen <bernalex <AT> gentoo.org>
bin/portageq | 2 +-
pym/_emerge/MiscFunctionsProcess.py | 3 +--
pym/_emerge/actions.py | 2 +-
pym/_emerge/depgraph.py | 12 ++++--------
pym/_emerge/resolver/output.py | 3 +--
pym/portage/__init__.py | 9 ---------
pym/portage/dbapi/porttree.py | 4 ++--
pym/portage/dbapi/vartree.py | 3 +--
pym/portage/news.py | 3 +--
pym/portage/package/ebuild/doebuild.py | 6 +++---
pym/portage/repository/config.py | 2 +-
pym/portage/sync/modules/cvs/cvs.py | 4 ++--
pym/portage/sync/modules/git/git.py | 4 ++--
pym/portage/sync/modules/rsync/rsync.py | 4 ++--
pym/portage/sync/modules/svn/svn.py | 6 +++---
pym/portage/sync/modules/webrsync/webrsync.py | 2 +-
pym/portage/util/__init__.py | 2 +-
pym/portage/util/configparser.py | 5 ++---
repoman/pym/repoman/modules/scan/ebuild/checks.py | 2 +-
19 files changed, 30 insertions(+), 48 deletions(-)
diff --git a/bin/portageq b/bin/portageq
index 832d004..d645635 100755
--- a/bin/portageq
+++ b/bin/portageq
@@ -1281,7 +1281,7 @@ def add_pquery_arguments(parser):
kwargs["help"] = opt_info["help"]
except KeyError:
pass
- arg_group.add_argument(*pargs, **portage._native_kwargs(kwargs))
+ arg_group.add_argument(*pargs, **kwargs)
def usage(argv):
diff --git a/pym/_emerge/MiscFunctionsProcess.py b/pym/_emerge/MiscFunctionsProcess.py
index b7f5892..99cf598 100644
--- a/pym/_emerge/MiscFunctionsProcess.py
+++ b/pym/_emerge/MiscFunctionsProcess.py
@@ -40,8 +40,7 @@ class MiscFunctionsProcess(AbstractEbuildProcess):
# think this is a real phase.
phase_backup = self.settings.pop("EBUILD_PHASE", None)
try:
- return spawn(" ".join(args), self.settings,
- **portage._native_kwargs(kwargs))
+ return spawn(" ".join(args), self.settings, **kwargs)
finally:
if phase_backup is not None:
self.settings["EBUILD_PHASE"] = phase_backup
diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py
index 59626ad..2ca7902 100644
--- a/pym/_emerge/actions.py
+++ b/pym/_emerge/actions.py
@@ -2378,7 +2378,7 @@ def load_emerge_config(emerge_config=None, **kargs):
if v and v.strip():
kwargs[k] = v
emerge_config.trees = portage.create_trees(trees=emerge_config.trees,
- **portage._native_kwargs(kwargs))
+ **kwargs)
for root_trees in emerge_config.trees.values():
settings = root_trees["vartree"].settings
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index cfaafa3..f78f08d 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -4175,8 +4175,7 @@ class depgraph(object):
pargs, kwargs = item
kwargs = kwargs.copy()
kwargs['collect_use_changes'] = True
- if not self._show_unsatisfied_dep(*pargs,
- **portage._native_kwargs(kwargs)):
+ if not self._show_unsatisfied_dep(*pargs, **kwargs):
remaining_items.append(item)
if len(remaining_items) != len(self._dynamic_config._unsatisfied_deps_for_display):
self._dynamic_config._unsatisfied_deps_for_display = remaining_items
@@ -4327,8 +4326,7 @@ class depgraph(object):
not been scheduled for replacement.
"""
kwargs["trees"] = self._dynamic_config._graph_trees
- return self._select_atoms_highest_available(*pargs,
- **portage._native_kwargs(kwargs))
+ return self._select_atoms_highest_available(*pargs, **kwargs)
def _select_atoms_highest_available(self, root, depstring,
myuse=None, parent=None, strict=True, trees=None, priority=None):
@@ -8511,8 +8509,7 @@ class depgraph(object):
writemsg("\n", noiselevel=-1)
for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display:
- self._show_unsatisfied_dep(*pargs,
- **portage._native_kwargs(kwargs))
+ self._show_unsatisfied_dep(*pargs, **kwargs)
if self._dynamic_config._buildpkgonly_deps_unsatisfied:
self._show_merge_list()
@@ -8879,8 +8876,7 @@ class depgraph(object):
try:
for pargs, kwargs in self._dynamic_config._unsatisfied_deps_for_display:
self._show_unsatisfied_dep(
- *pargs, check_autounmask_breakage=True,
- **portage._native_kwargs(kwargs))
+ *pargs, check_autounmask_breakage=True, **kwargs)
except self._autounmask_breakage:
return True
return False
diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py
index ac979f6..e993ce1 100644
--- a/pym/_emerge/resolver/output.py
+++ b/pym/_emerge/resolver/output.py
@@ -310,8 +310,7 @@ class Display(object):
kwargs["myrepo"] = pkg.repo
myfilesdict = None
try:
- myfilesdict = db.getfetchsizes(pkg.cpv,
- **portage._native_kwargs(kwargs))
+ myfilesdict = db.getfetchsizes(pkg.cpv, **kwargs)
except InvalidDependString as e:
# FIXME: validate SRC_URI earlier
depstr, = db.aux_get(pkg.cpv,
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 1c85042..0612e22 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -211,15 +211,6 @@ else:
_native_string = _unicode_encode
-if sys.hexversion >= 0x20605f0:
- def _native_kwargs(kwargs):
- return kwargs
-else:
- # Avoid "TypeError: keywords must be strings" issue triggered
- # by unicode_literals: http://bugs.python.org/issue4978
- def _native_kwargs(kwargs):
- return dict((_native_string(k), v) for k, v in kwargs.iteritems())
-
class _unicode_func_wrapper(object):
"""
Wraps a function, converts arguments from unicode to bytes,
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py
index 1f4374e..a3254d0 100644
--- a/pym/portage/dbapi/porttree.py
+++ b/pym/portage/dbapi/porttree.py
@@ -213,10 +213,10 @@ class portdbapi(dbapi):
# portage group.
depcachedir_unshared = True
else:
- cache_kwargs.update(portage._native_kwargs({
+ cache_kwargs.update({
'gid' : portage_gid,
'perms' : 0o664
- }))
+ })
# If secpass < 1, we don't want to write to the cache
# since then we won't be able to apply group permissions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 6209a86..bfbe356 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -5181,8 +5181,7 @@ class dblink(object):
else:
kwargs['mode'] = 'w'
kwargs['encoding'] = _encodings['repo.content']
- write_atomic(os.path.join(self.dbdir, fname), data,
- **portage._native_kwargs(kwargs))
+ write_atomic(os.path.join(self.dbdir, fname), data, **kwargs)
def getelements(self,ename):
if not os.path.exists(self.dbdir+"/"+ename):
diff --git a/pym/portage/news.py b/pym/portage/news.py
index ea1b947..177f9db 100644
--- a/pym/portage/news.py
+++ b/pym/portage/news.py
@@ -246,8 +246,7 @@ class NewsItem(object):
for values in self.restrictions.values():
any_match = False
for restriction in values:
- if restriction.checkRestriction(
- **portage._native_kwargs(kwargs)):
+ if restriction.checkRestriction(**kwargs):
any_match = True
if not any_match:
all_match = False
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py
index d926e03..26e6123 100644
--- a/pym/portage/package/ebuild/doebuild.py
+++ b/pym/portage/package/ebuild/doebuild.py
@@ -166,7 +166,7 @@ def _doebuild_spawn(phase, settings, actionmap=None, **kwargs):
settings['EBUILD_PHASE'] = phase
try:
- return spawn(cmd, settings, **portage._native_kwargs(kwargs))
+ return spawn(cmd, settings, **kwargs)
finally:
settings.pop('EBUILD_PHASE', None)
@@ -1633,14 +1633,14 @@ def spawn(mystring, mysettings, debug=False, free=False, droppriv=False,
try:
if keywords.get("returnpid"):
return spawn_func(mystring, env=mysettings.environ(),
- **portage._native_kwargs(keywords))
+ **keywords)
proc = EbuildSpawnProcess(
background=False, args=mystring,
scheduler=SchedulerInterface(portage._internal_caller and
global_event_loop() or EventLoop(main=False)),
spawn_func=spawn_func,
- settings=mysettings, **portage._native_kwargs(keywords))
+ settings=mysettings, **keywords)
proc.start()
proc.wait()
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index a23f4bd..0512057 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -329,7 +329,7 @@ class RepoConfig(object):
if self.disable_manifest:
kwds['from_scratch'] = True
kwds['find_invalid_path_char'] = self.find_invalid_path_char
- return manifest.Manifest(*args, **portage._native_kwargs(kwds))
+ return manifest.Manifest(*args, **kwds)
def update(self, new_repo):
"""Update repository with options in another RepoConfig"""
diff --git a/pym/portage/sync/modules/cvs/cvs.py b/pym/portage/sync/modules/cvs/cvs.py
index 7b7908b..e202560 100644
--- a/pym/portage/sync/modules/cvs/cvs.py
+++ b/pym/portage/sync/modules/cvs/cvs.py
@@ -38,7 +38,7 @@ class CVSSync(NewBase):
(portage._shell_quote(os.path.dirname(self.repo.location)), portage._shell_quote(cvs_root),
portage._shell_quote(os.path.basename(self.repo.location)),
portage._shell_quote(self.repo.module_specific_options["sync-cvs-repo"])),
- **portage._native_kwargs(self.spawn_kwargs)) != os.EX_OK:
+ **self.spawn_kwargs) != os.EX_OK:
msg = "!!! cvs checkout error; exiting."
self.logger(self.xterm_titles, msg)
writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR)
@@ -59,7 +59,7 @@ class CVSSync(NewBase):
exitcode = portage.process.spawn_bash(
"cd %s; exec cvs -z0 -q update -dP" % \
(portage._shell_quote(self.repo.location),),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! cvs update error; exiting."
self.logger(self.xterm_titles, msg)
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py
index e6724f6..02eeb16 100644
--- a/pym/portage/sync/modules/git/git.py
+++ b/pym/portage/sync/modules/git/git.py
@@ -62,7 +62,7 @@ class GitSync(NewBase):
exitcode = portage.process.spawn_bash("cd %s ; exec %s" % (
portage._shell_quote(self.repo.location), git_cmd),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! git clone error in %s" % self.repo.location
self.logger(self.xterm_titles, msg)
@@ -92,7 +92,7 @@ class GitSync(NewBase):
exitcode = portage.process.spawn_bash("cd %s ; exec %s" % (
portage._shell_quote(self.repo.location), git_cmd),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! git pull error in %s" % self.repo.location
self.logger(self.xterm_titles, msg)
diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py
index e0f76b3..cf95835 100644
--- a/pym/portage/sync/modules/rsync/rsync.py
+++ b/pym/portage/sync/modules/rsync/rsync.py
@@ -438,7 +438,7 @@ class RsyncSync(NewBase):
pids.extend(portage.process.spawn(
command, returnpid=True,
- **portage._native_kwargs(self.spawn_kwargs)))
+ **self.spawn_kwargs))
exitcode = os.waitpid(pids[0], 0)[1]
if self.usersync_uid is not None:
portage.util.apply_permissions(tmpservertimestampfile,
@@ -522,7 +522,7 @@ class RsyncSync(NewBase):
exitcode = None
try:
exitcode = portage.process.spawn(command,
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
finally:
if exitcode is None:
# interrupted
diff --git a/pym/portage/sync/modules/svn/svn.py b/pym/portage/sync/modules/svn/svn.py
index da38e6f..723beed 100644
--- a/pym/portage/sync/modules/svn/svn.py
+++ b/pym/portage/sync/modules/svn/svn.py
@@ -37,7 +37,7 @@ class SVNSync(NewBase):
"cd %s; exec svn co %s ." %
(portage._shell_quote(self.repo.location),
portage._shell_quote(svn_root)),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! svn checkout error; exiting."
self.logger(self.xterm_titles, msg)
@@ -62,7 +62,7 @@ class SVNSync(NewBase):
exitcode = portage.process.spawn_bash(
"cd %s; exec svn update" % \
(portage._shell_quote(self.repo.location),),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! svn update error; exiting."
self.logger(self.xterm_titles, msg)
@@ -81,7 +81,7 @@ class SVNSync(NewBase):
exitcode = portage.process.spawn_bash(
"cd %s; exec svn upgrade" %
(portage._shell_quote(self.repo.location),),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! svn upgrade error; exiting."
self.logger(self.xterm_titles, msg)
diff --git a/pym/portage/sync/modules/webrsync/webrsync.py b/pym/portage/sync/modules/webrsync/webrsync.py
index 92208b5..3d79f45 100644
--- a/pym/portage/sync/modules/webrsync/webrsync.py
+++ b/pym/portage/sync/modules/webrsync/webrsync.py
@@ -41,7 +41,7 @@ class WebRsync(SyncBase):
exitcode = portage.process.spawn_bash("%s" % \
(self.bin_command),
- **portage._native_kwargs(self.spawn_kwargs))
+ **self.spawn_kwargs)
if exitcode != os.EX_OK:
msg = "!!! emerge-webrsync error in %s" % self.repo.location
self.logger(self.xterm_titles, msg)
diff --git a/pym/portage/util/__init__.py b/pym/portage/util/__init__.py
index 417fb98..c6d6a84 100644
--- a/pym/portage/util/__init__.py
+++ b/pym/portage/util/__init__.py
@@ -1285,7 +1285,7 @@ class atomic_ofstream(ObjectProxy):
object.__setattr__(self, '_file',
open_func(_unicode_encode(tmp_name,
encoding=_encodings['fs'], errors='strict'),
- mode=mode, **portage._native_kwargs(kargs)))
+ mode=mode, **kargs))
return
except IOError as e:
if canonical_path == filename:
diff --git a/pym/portage/util/configparser.py b/pym/portage/util/configparser.py
index fb1a351..c4c92a6 100644
--- a/pym/portage/util/configparser.py
+++ b/pym/portage/util/configparser.py
@@ -23,7 +23,6 @@ except ImportError:
NoOptionError, ParsingError, RawConfigParser, SafeConfigParser)
from portage import _encodings
-from portage import _native_kwargs
from portage import _unicode_encode
@@ -66,12 +65,12 @@ def read_configs(parser, paths):
# because it assumes that f.name is a native string rather
# than binary when constructing error messages.
kwargs = {source_kwarg: p}
- read_file(f, **_native_kwargs(kwargs))
+ read_file(f, **kwargs)
finally:
if f is not None:
f.close()
elif isinstance(p, io.StringIO):
kwargs = {source_kwarg: "<io.StringIO>"}
- read_file(p, **_native_kwargs(kwargs))
+ read_file(p, **kwargs)
else:
raise TypeError("Unsupported type %r of element %r of 'paths' argument" % (type(p), p))
diff --git a/repoman/pym/repoman/modules/scan/ebuild/checks.py b/repoman/pym/repoman/modules/scan/ebuild/checks.py
index fb3e019..15e2251 100644
--- a/repoman/pym/repoman/modules/scan/ebuild/checks.py
+++ b/repoman/pym/repoman/modules/scan/ebuild/checks.py
@@ -917,7 +917,7 @@ def checks_init(experimental_inherit=False):
isinstance(v, type)
and issubclass(v, LineCheck)
and v not in _base_check_classes)), (
- InheritEclass(k, **portage._native_kwargs(kwargs))
+ InheritEclass(k, **kwargs)
for k, kwargs in _eclass_info.items())))
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-31 13:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-31 13:45 [gentoo-commits] proj/portage:master commit in: bin/, pym/portage/util/, pym/_emerge/resolver/, pym/portage/sync/modules/rsync/, Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox