From 8b4ec9c72cd8c4e8f02c3318169a0803516f76bb Mon Sep 17 00:00:00 2001 From: Nusan Date: Mon, 14 Nov 2022 22:05:07 +0100 Subject: [PATCH] Fix usage with Python 3.11 --- FoxDot/lib/Effects/NewEffects.py | 2 +- FoxDot/lib/Patterns/Main.py | 4 ++-- FoxDot/lib/Repeat.py | 2 +- FoxDot/lib/TempoClock.py | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/FoxDot/lib/Effects/NewEffects.py b/FoxDot/lib/Effects/NewEffects.py index 6d2a1c04..7ca67ba8 100644 --- a/FoxDot/lib/Effects/NewEffects.py +++ b/FoxDot/lib/Effects/NewEffects.py @@ -14,7 +14,7 @@ def __init__(self): self.lines = [] def __call__(self, order=0): def decorator(effect): - effect_data = inspect.getargspec(effect) # Original args and defaults + effect_data = inspect.getfullargspec(effect) # Original args and defaults # Get filename from function name filename = "{}.scd".format(effect.__name__)# filename diff --git a/FoxDot/lib/Patterns/Main.py b/FoxDot/lib/Patterns/Main.py index af39e995..62df84d5 100644 --- a/FoxDot/lib/Patterns/Main.py +++ b/FoxDot/lib/Patterns/Main.py @@ -34,7 +34,7 @@ def new_function(*args): for i in range(LCM(*[len(arg) for arg in args if (hasattr(arg, '__len__') and not isinstance(arg, PGroup))])): pat |= f(*[(arg[i] if isinstance(arg, Pattern) else arg) for arg in args]) return pat - new_function.argspec = inspect.getargspec(f) + new_function.argspec = inspect.getfullargspec(f) return new_function # TODO -- if it isn't looped, return the original if it is a group @@ -58,7 +58,7 @@ def new_function(self, *args): pat |= f(self, *[(modi(arg, i) if not isinstance(arg, PGroup) else arg) for arg in args]) return pat - new_function.argspec = inspect.getargspec(f) + new_function.argspec = inspect.getfullargspec(f) return new_function def PatternMethod(f): diff --git a/FoxDot/lib/Repeat.py b/FoxDot/lib/Repeat.py index c33bc1ab..f0b24858 100644 --- a/FoxDot/lib/Repeat.py +++ b/FoxDot/lib/Repeat.py @@ -424,7 +424,7 @@ def update(self, n, cycle=None, args=(), kwargs={}): # Check if a method has the _beat_ keyword argument - if "_beat_" in inspect.getargspec(self.method).args: + if "_beat_" in inspect.getfullargspec(self.method).args: self.kwargs["_beat_"] = None diff --git a/FoxDot/lib/TempoClock.py b/FoxDot/lib/TempoClock.py index a44156df..550969ee 100644 --- a/FoxDot/lib/TempoClock.py +++ b/FoxDot/lib/TempoClock.py @@ -765,15 +765,15 @@ def add(self, item, beat, args=(), kwargs={}, is_priority=False): try: - function = inspect.getargspec(item) + function = inspect.getfullargspec(item) except TypeError: - function = inspect.getargspec(item.__call__) + function = inspect.getfullargspec(item.__call__) # If the item can't take arbitrary keywords, check any kwargs are valid - if function.keywords is None: + if function.varkw is None: for key in list(kwargs.keys()):