Merge pull request #56094 from dwoz/fix_56063

Fix type error in TornadoImporter
This commit is contained in:
Daniel Wozniak 2020-03-09 18:39:07 -07:00 committed by GitHub
commit 211c88bfbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -12,7 +12,7 @@ import importlib
class TornadoImporter(object):
def find_module(self, module_name, package_path):
def find_module(self, module_name, package_path=None):
if module_name.startswith('tornado'):
return self
return None

View file

@ -14,6 +14,7 @@ from tests.support.runtests import RUNTIME_VARS
import tests.support.helpers
# Import Salt libs
import salt
import salt.ext.six
import salt.modules.cmdmod
import salt.utils.platform
@ -95,3 +96,10 @@ class VendorTornadoTest(TestCase):
log.error("Test found bad line: %s", line)
valid_lines.append(line)
assert valid_lines == [], len(valid_lines)
def test_regression_56063(self):
importer = salt.TornadoImporter()
try:
importer.find_module('tornado')
except TypeError:
assert False, 'TornadoImporter raised type error when one argument passed'