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

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

7 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.brain.helpers import register_module_extender 

6from astroid.builder import parse 

7from astroid.manager import AstroidManager 

8 

9 

10def _thread_transform(): 

11 return parse( 

12 """ 

13 class lock(object): 

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

15 return False 

16 def release(self): 

17 pass 

18 def __enter__(self): 

19 return True 

20 def __exit__(self, *args): 

21 pass 

22 def locked(self): 

23 return False 

24 

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

26 return lock() 

27 """ 

28 ) 

29 

30 

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

32 register_module_extender(manager, "threading", _thread_transform)