Skip to content

Commit

Permalink
Use _imp instead of deprecated imp
Browse files Browse the repository at this point in the history
Module imp is deprecated in favour of importlib. But importlib doesn't
support acquire_lock/release_lock/lock_held. Use internal _imp module
instead.
  • Loading branch information
onovy authored and temoto committed Mar 17, 2021
1 parent 83b14ed commit e16fcab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion eventlet/patcher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import imp
try:
import _imp as imp
except ImportError:
import imp
import sys
try:
# Only for this purpose, it's irrelevant if `os` was already patched.
Expand Down
5 changes: 4 additions & 1 deletion eventlet/tpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
# limitations under the License.

import atexit
import imp
try:
import _imp as imp
except ImportError:
import imp
import os
import sys
import traceback
Expand Down

0 comments on commit e16fcab

Please sign in to comment.