Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

brain_threading.py 656B

1234567891011121314151617181920212223242526
  1. # Copyright (c) 2016 Claudiu Popa <pcmanticore@gmail.com>
  2. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  3. # For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
  4. import astroid
  5. def _thread_transform():
  6. return astroid.parse('''
  7. class lock(object):
  8. def acquire(self, blocking=True):
  9. pass
  10. def release(self):
  11. pass
  12. def __enter__(self):
  13. return True
  14. def __exit__(self, *args):
  15. pass
  16. def Lock():
  17. return lock()
  18. ''')
  19. astroid.register_module_extender(astroid.MANAGER, 'threading', _thread_transform)