fixed CI.. again, also type hinting callables is a pain
This commit is contained in:
parent
39f53ce99e
commit
031d9c6399
|
@ -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
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -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__,
|
||||
|
|
Loading…
Reference in a new issue