Refs #21628 -- removed one usage of the imp module in the tests. It is deprecated in Python 3.4
This commit is contained in:
parent
10e0cfc0e4
commit
9d487ae2a1
|
@ -9,9 +9,9 @@ from django.conf import settings
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
settings.configure()
|
settings.configure()
|
||||||
|
|
||||||
import imp
|
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
import types
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -41,7 +41,7 @@ def create_egg(name, resources):
|
||||||
name: The name of the module.
|
name: The name of the module.
|
||||||
resources: A dictionary of resources. Keys are the names and values the data.
|
resources: A dictionary of resources. Keys are the names and values the data.
|
||||||
"""
|
"""
|
||||||
egg = imp.new_module(name)
|
egg = types.ModuleType(name)
|
||||||
egg.__loader__ = MockLoader()
|
egg.__loader__ = MockLoader()
|
||||||
egg._resources = resources
|
egg._resources = resources
|
||||||
sys.modules[name] = egg
|
sys.modules[name] = egg
|
||||||
|
|
Loading…
Reference in New Issue