Skip to content

Commit

Permalink
Merge 8772bd0 into c53e548
Browse files Browse the repository at this point in the history
  • Loading branch information
mwichmann committed Sep 8, 2018
2 parents c53e548 + 8772bd0 commit 728723a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ RELEASE 3.1.0.alpha.yyyymmdd - NEW DATE WILL BE INSERTED HERE
time.clock deprecated since py3.3, due to remove in 3.8. deprecation
warnings from py3.7 were failing a bunch of tests on Windows since they
mess up expected stderr.
- Prefer Py3's inspect.getfullargspec over deprecated inspect.getargspec.
Switched to "new" (standard in Py2.7) usage of receiving a namedtuple -
we were unpacking to a four-tuple, two of the items of which were unused;
getfullargspec returns a named tuple with seven elements so it is a
cleaner drop-in replacement using the namedtuple.

From Hao Wu
- typo in customized decider example in user guide
Expand Down
16 changes: 11 additions & 5 deletions src/engine/SCons/Tool/packaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,21 @@ def load_packager(type):
# this exception means that a needed argument for the packager is
# missing. As our packagers get their "tags" as named function
# arguments we need to find out which one is missing.
from inspect import getargspec
args,varargs,varkw,defaults=getargspec(packager.package)
if defaults!=None:
args=args[:-len(defaults)] # throw away arguments with default values
#TODO: getargspec deprecated in Py3. cleanup when Py2.7 dropped.
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec
argspec = getargspec(packager.package)
args = argspec.args
if argspec.defaults:
# throw away arguments with default values
args = args[:-len(argspec.defaults)]
args.remove('env')
args.remove('target')
args.remove('source')
# now remove any args for which we have a value in kw.
args=[x for x in args if x not in kw]
args = [x for x in args if x not in kw]

if len(args)==0:
raise # must be a different error, so re-raise
Expand Down

0 comments on commit 728723a

Please sign in to comment.