Commit f66b3ec9 authored by Alex Pearce's avatar Alex Pearce Committed by kreczko
Browse files

Use *args and **kwargs rather than apply.

apply has been deprecated since 2.3+.
parent e6e57979
......@@ -17,7 +17,7 @@ from GaudiKernel.ConfigurableDb import cfgDb
logging.VERBOSE = (logging.INFO + logging.DEBUG) / 2
logging.addLevelName(logging.VERBOSE, "VERBOSE")
logging.verbose = lambda msg, *args, **kwargs: \
apply(logging.log, (logging.VERBOSE, msg) + args, kwargs)
logging.log(logging.VERBOSE, msg, *args, **kwargs)
def _inheritsfrom(derived, basenames):
......
......@@ -16,13 +16,13 @@ def command(cmd, *args, **kwargs):
d.update(kwargs)
cmd = [cmd] + list(args)
logging.debug("Execute command: %r %r", " ".join(cmd), kwargs)
proc = apply(Popen, (cmd, ), d)
proc = Popen(cmd, **d)
return proc.communicate()
cmt = lambda *args, **kwargs: apply(command, ("cmt", ) + args, kwargs)
cvs = lambda *args, **kwargs: apply(command, ("cvs", ) + args, kwargs)
svn = lambda *args, **kwargs: apply(command, ("svn", ) + args, kwargs)
cmt = lambda *args, **kwargs: command("cmt", *args, **kwargs)
cvs = lambda *args, **kwargs: command("cvs", *args, **kwargs)
svn = lambda *args, **kwargs: command("svn", *args, **kwargs)
def broadcast_packages():
......
......@@ -77,7 +77,7 @@ class QMTTest(BaseTest):
# positional or keyword
if a not in positional and a not in kwargs:
kwargs[a] = self.extra_args[a]
return apply(self.callable, args, kwargs)
return self.callable(*args, **kwargs)
# local names to be exposed in the script
stdout_ref = self._expandReferenceFileName(self.reference)
......
......@@ -1540,8 +1540,7 @@ class GaudiExeTest(ExecTestBase):
# positional or keyword
if a not in positional and a not in kwargs:
kwargs[a] = self.extra_args[a]
return apply(self.callable, args, kwargs)
return self.callable(*args, **kwargs)
# local names to be exposed in the script
exported_symbols = {
"self":
......
......@@ -720,7 +720,7 @@ class iHistogramSvc(iDataSvc):
>>> svc = ...
>>> histo = svc.book( .... )
"""
return apply(self._ihs.book, args)
return self._ihs.book(*args)
def bookProf(self, *args):
"""
......@@ -728,7 +728,7 @@ class iHistogramSvc(iDataSvc):
>>> svc = ...
>>> histo = svc.bookProf( .... )
"""
return apply(self._ihs.bookProf, args)
return self._ihs.bookProf(*args)
def __getitem__(self, path):
"""
......@@ -774,7 +774,7 @@ class iNTupleSvc(iDataSvc):
iDataSvc.__init__(self, name, ints)
def book(self, *args):
return apply(self._ints.book, args)
return self._ints.book(*args)
def defineOutput(self, files, typ="Gaudi::RootCnvSvc"):
""" Defines the mapping between logical names and the output file
......
......@@ -18,7 +18,7 @@ from ConfigParser import ConfigParser
def svn(*args, **kwargs):
print "> svn", " ".join(args)
return apply(Popen, (["svn"] + list(args), ), kwargs)
return Popen(["svn"] + list(args), **kwargs)
def svn_ls(url):
......@@ -42,7 +42,7 @@ def svn_exists(url):
def checkout_structure(url, proj, branch):
def checkout_level(base):
dirs = ["%s/%s" % (base, d) for d in svn_ls(base) if d.endswith("/")]
apply(svn, ["up", "-N"] + dirs).wait()
svn("up", "-N", *args).wait()
return dirs
root = basename(url)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment