3
3
| Author | Michele Simionato|
4
4
| ---| ---|
5
5
| E-mail | michele.simionato@gmail.com |
6
- | Version| 5.1.1 (2022-01-07 )|
7
- | Supports| Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13 |
8
- | Download page| https://pypi.org/project/decorator/5.1.1 |
6
+ | Version| 5.2.0 (2025-02-22 )|
7
+ | Supports| Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12|
8
+ | Download page| https://pypi.org/project/decorator/5.2.0 |
9
9
| Installation| `` pip install decorator `` |
10
10
| License | BSD license|
11
11
@@ -1042,7 +1042,7 @@ write code like the following:
1042
1042
``` python
1043
1043
import time
1044
1044
import logging
1045
- from asyncio import get_event_loop , sleep, wait
1045
+ from asyncio import run , sleep, wait
1046
1046
from decorator import decorator
1047
1047
1048
1048
@decorator
@@ -1061,7 +1061,7 @@ async def make_task(n):
1061
1061
if __name__ == ' __main__' :
1062
1062
logging.basicConfig(level = logging.INFO )
1063
1063
tasks = [make_task(3 ), make_task(2 ), make_task(1 )]
1064
- get_event_loop().run_until_complete (wait(tasks))
1064
+ run (wait(tasks))
1065
1065
```
1066
1066
1067
1067
and you will get an output like this:
@@ -1090,7 +1090,7 @@ into regular functions, such as the following:
1090
1090
@decorator
1091
1091
def coro_to_func (coro , * args , ** kw ):
1092
1092
" Convert a coroutine into a function"
1093
- return get_event_loop().run_until_complete (coro(* args, ** kw))
1093
+ return run (coro(* args, ** kw))
1094
1094
```
1095
1095
1096
1096
Notice the difference: the caller in `` log_start_stop `` was a coroutine
@@ -1663,7 +1663,7 @@ penalty in your specific use case is to measure it.
1663
1663
1664
1664
## LICENSE (2-clause BSD)
1665
1665
1666
- Copyright (c) 2005-2020 , Michele Simionato
1666
+ Copyright (c) 2005-2025 , Michele Simionato
1667
1667
All rights reserved.
1668
1668
1669
1669
Redistribution and use in source and binary forms, with or without
@@ -1692,4 +1692,4 @@ DAMAGE.
1692
1692
1693
1693
If you use this software and you are happy with it, consider sending me a
1694
1694
note, just to gratify my ego. On the other hand, if you use this software and
1695
- you are unhappy with it, send me a patch!
1695
+ you are unhappy with it, send me a patch!
0 commit comments