lists.arthurdejong.org
RSS feed

python-stdnum branch master updated. 1.20-8-g0da257c

[Date Prev][Date Next] [Thread Prev][Thread Next]

python-stdnum branch master updated. 1.20-8-g0da257c



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-stdnum".

The branch, master has been updated
       via  0da257c6646c2565eeb1820e3d2a1a1d95d12884 (commit)
      from  e951daca447f678f5a3f3c70dcc535eb8d7449b4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://arthurdejong.org/git/python-stdnum/commit/?id=0da257c6646c2565eeb1820e3d2a1a1d95d12884

commit 0da257c6646c2565eeb1820e3d2a1a1d95d12884
Author: Arthur de Jong <arthur@arthurdejong.org>
Date:   Mon Jul 15 19:25:23 2024 +0200

    Replace use of deprecated inspect.getargspec()
    
    Use the inspect.signature() function instead. The inspect.getargspec()
    function was removed in Python 3.11.

diff --git a/online_check/stdnum.wsgi b/online_check/stdnum.wsgi
index f65c959..6115d6c 100755
--- a/online_check/stdnum.wsgi
+++ b/online_check/stdnum.wsgi
@@ -1,6 +1,6 @@
 # stdnum.wsgi - simple WSGI application to check numbers
 #
-# Copyright (C) 2017-2023 Arthur de Jong
+# Copyright (C) 2017-2024 Arthur de Jong
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -43,9 +43,8 @@ def get_conversions(module, number):
     """Return the possible conversions for the number."""
     for name, func in inspect.getmembers(module, inspect.isfunction):
         if name.startswith('to_') or name.startswith('get_'):
-            args, varargs, varkw, defaults = inspect.getargspec(func)
-            if defaults:
-                args = args[:-len(defaults)]
+            signature = inspect.signature(func)
+            args = [p.name for p in signature.parameters.values() if p.default 
== p.empty]
             if args == ['number'] and not name.endswith('binary'):
                 try:
                     prop = name.split('_', 1)[1].replace('_', ' ')

-----------------------------------------------------------------------

Summary of changes:
 online_check/stdnum.wsgi | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
python-stdnum