Skip to content

Fix deprecations warnings #678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bpython/curtsiesfrontend/manual_readline.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@

import inspect
from six import iteritems
from bpython._py3compat import py3

INDENT = 4

# TODO Allow user config of keybindings for these actions
if not py3:
getargspec = lambda func: inspect.getargspec(func)[0]
else:
getargspec = lambda func: inspect.signature(func).parameters


class AbstractEdits(object):
Expand All @@ -38,7 +43,7 @@ def add(self, key, func, overwrite=False):
del self[key]
else:
raise ValueError('key %r already has a mapping' % (key,))
params = inspect.getargspec(func)[0]
params = getargspec(func)
args = dict((k, v) for k, v in iteritems(self.default_kwargs)
if k in params)
r = func(**args)
Expand All @@ -64,7 +69,7 @@ def add_config_attr(self, config_attr, func):

def call(self, key, **kwargs):
func = self[key]
params = inspect.getargspec(func)[0]
params = getargspec(func)
args = dict((k, v) for k, v in kwargs.items() if k in params)
return func(**args)

Expand Down