Skip to content

Commit

Permalink
use inspect.getfullargspec for Python3
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Oct 23, 2018
1 parent 744cbd9 commit e278951
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_height_fwhm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

import os

if sys.version_info[0] == 2:
inspect_args = inspect.getargspec
elif sys.version_info[0] == 3:
inspect_args = inspect.getfullargspec


def check_height_fwhm(x, y, lineshape, model, with_plot=False, report=False):
"""Check height and fwhm parameters"""
Expand All @@ -26,7 +31,7 @@ def check_height_fwhm(x, y, lineshape, model, with_plot=False, report=False):
cen = mu
# get arguments for lineshape
args = {key: out.best_values[key] for key in
inspect.getargspec(lineshape)[0] if key is not 'x'}
inspect_args(lineshape)[0] if key is not 'x'}
# output format for assertion errors
fmt = ("Program calculated values and real values do not match!\n"
"{:^20s}{:^20s}{:^20s}{:^20s}\n"
Expand Down

0 comments on commit e278951

Please sign in to comment.