Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.10/site-packages/astroid/brain/brain_threading.py: 88%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

8 statements  

1# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html 

2# For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE 

3# Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt 

4 

5from astroid import nodes 

6from astroid.brain.helpers import register_module_extender 

7from astroid.builder import parse 

8from astroid.manager import AstroidManager 

9 

10 

11def _thread_transform() -> nodes.Module: 

12 return parse( 

13 """ 

14 class lock(object): 

15 def acquire(self, blocking=True, timeout=-1): 

16 return False 

17 def release(self): 

18 pass 

19 def __enter__(self): 

20 return True 

21 def __exit__(self, *args): 

22 pass 

23 def locked(self): 

24 return False 

25 

26 def Lock(*args, **kwargs): 

27 return lock() 

28 """ 

29 ) 

30 

31 

32def register(manager: AstroidManager) -> None: 

33 register_module_extender(manager, "threading", _thread_transform)