fixed CI.. again, also type hinting callables is a pain

This commit is contained in:
Ari Archer 2021-11-29 16:40:19 +02:00
parent 39f53ce99e
commit 031d9c6399
Signed by untrusted user who does not match committer: ari
GPG key ID: A50D5B4B599AF8A2
2 changed files with 7 additions and 7 deletions

View file

@ -17,6 +17,7 @@ from arigram.models import Model
from arigram.msg import MsgProxy
from arigram.tdlib import ChatAction, ChatType, Tdlib, get_chat_type
from arigram.utils import (
copy_func,
get_duration,
get_mime,
get_video_resolution,
@ -24,9 +25,8 @@ from arigram.utils import (
is_no,
is_yes,
notify,
suspend,
rename_function,
copy_func,
suspend,
)
from arigram.views import View
@ -964,7 +964,7 @@ class Controller:
setattr(
self,
function_name,
copy_func(handle),
copy_func(handle), # type: ignore
)

View file

@ -1,5 +1,6 @@
import base64
import curses
import functools
import hashlib
import logging
import mailcap
@ -11,15 +12,14 @@ import shlex
import struct
import subprocess
import sys
import unicodedata
import types
import functools
import unicodedata
from datetime import datetime
from functools import lru_cache
from logging.handlers import RotatingFileHandler
from subprocess import CompletedProcess
from types import TracebackType
from typing import Any, Dict, Optional, Tuple, Type, Callable
from typing import Any, Callable, Dict, Optional, Tuple, Type
from arigram import config
@ -39,7 +39,7 @@ class LogWriter:
pass
def copy_func(f: Callable) -> Callable:
def copy_func(f: Callable) -> Callable: # type: ignore
"""Based on https://stackoverflow.com/a/6528148/190597 (Glenn Maynard)"""
g = types.FunctionType(
f.__code__,