[Python-modules-commits] r34461 - in packages/pyfits/trunk/debian (4 files)
aurel32 at users.alioth.debian.org
aurel32 at users.alioth.debian.org
Sat Oct 3 08:44:03 UTC 2015
Date: Saturday, October 3, 2015 @ 08:44:02
Author: aurel32
Revision: 34461
Add patches/04-replace-inspect-by-funcsigs.diff to use funcsigs
instead of inspect.getargspec which is deprecated in Python 3.5.
Closes: #800683.
Added:
packages/pyfits/trunk/debian/patches/04-replace-inspect-by-funcsigs.diff
Modified:
packages/pyfits/trunk/debian/changelog
packages/pyfits/trunk/debian/control
packages/pyfits/trunk/debian/patches/series
Modified: packages/pyfits/trunk/debian/changelog
===================================================================
--- packages/pyfits/trunk/debian/changelog 2015-10-03 08:41:34 UTC (rev 34460)
+++ packages/pyfits/trunk/debian/changelog 2015-10-03 08:44:02 UTC (rev 34461)
@@ -2,6 +2,9 @@
* Add patches/03-testsuite-ignore-deprecated.diff to not trigger
warnings when testing deprecated functions.
+ * Add patches/04-replace-inspect-by-funcsigs.diff to use funcsigs
+ instead of inspect.getargspec which is deprecated in Python 3.5.
+ Closes: #800683.
-- Aurelien Jarno <aurel32 at debian.org> Sat, 03 Oct 2015 10:22:20 +0200
Modified: packages/pyfits/trunk/debian/control
===================================================================
--- packages/pyfits/trunk/debian/control 2015-10-03 08:41:34 UTC (rev 34460)
+++ packages/pyfits/trunk/debian/control 2015-10-03 08:44:02 UTC (rev 34461)
@@ -3,7 +3,7 @@
Priority: optional
Maintainer: Debian Python Modules Team <python-modules-team at lists.alioth.debian.org>
Uploaders: Aurelien Jarno <aurel32 at debian.org>
-Build-Depends: debhelper (>= 9), libcfitsio-dev, dh-python, python-all-dev (>= 2.6.6-3~), python-setuptools, python-d2to1, python-stsci.distutils, python-numpy, python-nose, python3-all-dev (>= 3.1.2-6~), python3-setuptools, python3-d2to1, python3-stsci.distutils, python3-numpy, python3-nose
+Build-Depends: debhelper (>= 9), libcfitsio-dev, dh-python, python-all-dev (>= 2.6.6-3~), python-setuptools, python-d2to1, python-stsci.distutils, python-numpy, python-funcsigs, python-nose, python3-all-dev (>= 3.1.2-6~), python3-setuptools, python3-d2to1, python3-stsci.distutils, python3-numpy, python3-funcsigs, python3-nose
X-Python-Version: >= 2.5
X-Python3-Version: >= 3.0
Standards-Version: 3.9.6
Added: packages/pyfits/trunk/debian/patches/04-replace-inspect-by-funcsigs.diff
===================================================================
--- packages/pyfits/trunk/debian/patches/04-replace-inspect-by-funcsigs.diff (rev 0)
+++ packages/pyfits/trunk/debian/patches/04-replace-inspect-by-funcsigs.diff 2015-10-03 08:44:02 UTC (rev 34461)
@@ -0,0 +1,74 @@
+--- a/lib/pyfits/diff.py
++++ b/lib/pyfits/diff.py
+@@ -10,12 +10,12 @@
+ import fnmatch
+ import functools
+ import glob
+-import inspect
+ import textwrap
+ import sys
+
+ from collections import defaultdict
+ from itertools import islice
++from funcsigs import signature
+
+ import numpy as np
+
+@@ -102,10 +102,10 @@
+ ['*']
+ """
+
+- args, _, _, _ = inspect.getargspec(cls.__init__)
++ sig = signature(cls.__init__)
+ # The first 3 arguments of any Diff initializer are self, a, and b.
+ kwargs = {}
+- for arg in args[3:]:
++ for arg in list(sig.parameters.keys())[3:]:
+ if hasattr(other, arg):
+ kwargs[arg] = getattr(other, arg)
+
+--- a/lib/pyfits/hdu/base.py
++++ b/lib/pyfits/hdu/base.py
+@@ -2,12 +2,13 @@
+
+
+ import datetime
+-import inspect
+ import os
+ import warnings
+
+ import numpy as np
+
++from funcsigs import signature, Parameter
++
+ from ..extern.six import string_types
+ from ..extern.six.moves import range
+
+@@ -423,14 +424,14 @@
+ # self._kwargs. self._kwargs contains any number of optional arguments
+ # that may or may not be valid depending on the HDU type
+ cls = _hdu_class_from_header(cls, header)
+- args, varargs, varkwargs, defaults = inspect.getargspec(cls.__init__)
++ sig = signature(cls.__init__)
+ new_kwargs = kwargs.copy()
+- if not varkwargs:
++ if Parameter.VAR_KEYWORD not in (x.kind for x in sig.parameters.values()):
+ # If __init__ accepts arbitrary keyword arguments, then we can go
+ # ahead and pass all keyword arguments; otherwise we need to delete
+ # any that are invalid
+ for key in kwargs:
+- if key not in args:
++ if key not in sig.parameters:
+ del new_kwargs[key]
+
+ hdu = cls(data=DELAYED, header=header, **new_kwargs)
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -20,6 +20,7 @@
+ requires-python = >=2.5
+ requires-dist =
+ numpy
++ funcsigs
+
+ [files]
+ packages_root = lib
Modified: packages/pyfits/trunk/debian/patches/series
===================================================================
--- packages/pyfits/trunk/debian/patches/series 2015-10-03 08:41:34 UTC (rev 34460)
+++ packages/pyfits/trunk/debian/patches/series 2015-10-03 08:44:02 UTC (rev 34461)
@@ -1,3 +1,4 @@
01-system-cfitsio.diff
02-fitscheck-exception.diff
03-testsuite-ignore-deprecated.diff
+04-replace-inspect-by-funcsigs.diff
More information about the Python-modules-commits
mailing list