Skip to content

Commit

Permalink
Merge pull request #511 from Crozzers/remove-deprecated-imp-module
Browse files Browse the repository at this point in the history
Remove deprecated imp module (issue #510)
  • Loading branch information
nicholasserra committed Apr 30, 2023
2 parents 4cf766c + 50a9f17 commit bf3a3fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -7,6 +7,7 @@
- [pull #502] Replace deprecated `optparse` with `argparse`
- [pull #506] Fix `_uniform_outdent` failing with empty strings (issue #505)
- [pull #509] Fix HTML elements not unhashing correctly (issue 508)
- [pull #511] Remove deprecated `imp` module (issue #510)


## python-markdown2 2.4.8
Expand Down
7 changes: 3 additions & 4 deletions test/testlib.py
Expand Up @@ -54,14 +54,14 @@


import os
from os.path import join, basename, dirname, abspath, splitext, \
from os.path import join, basename, abspath, splitext, \
isfile, isdir, normpath, exists
import sys
import getopt
import glob
import time
import unittest
import imp
import importlib
import logging
import textwrap
import traceback
Expand Down Expand Up @@ -234,13 +234,12 @@ def testmods_from_testdir(testdir):
testmod_name = splitext(basename(testmod_path))[0]
log.debug("import test module '%s'", testmod_path)
try:
iinfo = imp.find_module(testmod_name, [dirname(testmod_path)])
testabsdir = abspath(testdir)
sys.path.insert(0, testabsdir)
old_dir = os.getcwd()
os.chdir(testdir)
try:
testmod = imp.load_module(testmod_name, *iinfo)
testmod = importlib.import_module(testmod_name)
finally:
os.chdir(old_dir)
sys.path.remove(testabsdir)
Expand Down

0 comments on commit bf3a3fd

Please sign in to comment.