Add python-eventlet 0.16.1
[packages/trusty/python-eventlet.git] / eventlet / tests / patcher_test_importlib_lock.py
1 from __future__ import print_function
2
3 import sys
4
5 import eventlet
6
7
8 # no standard tests in this file, ignore
9 __test__ = False
10
11
12 def do_import():
13     import encodings.idna
14
15
16 if __name__ == '__main__':
17     eventlet.monkey_patch()
18     threading = eventlet.patcher.original('threading')
19
20     sys.modules.pop('encodings.idna', None)
21
22     # call "import encodings.idna" in a new thread
23     thread = threading.Thread(target=do_import)
24     thread.start()
25
26     # call "import encodings.idna" in the main thread
27     do_import()
28
29     thread.join()
30     print('ok')