BPD tests: avoid os.fsdecode new in Py3.2

This commit is contained in:
Carl Suster 2019-03-29 11:55:09 +11:00
parent 14d0cc3b85
commit dfc5da70cd

View file

@ -247,14 +247,14 @@ class BPDTest(unittest.TestCase, TestHelper):
"""
# Create a config file:
config = {
'pluginpath': [os.fsdecode(self.temp_dir)],
'pluginpath': [py3_path(self.temp_dir)],
'plugins': 'bpd',
'bpd': {'host': host, 'port': port},
}
if password:
config['bpd']['password'] = password
config_file = tempfile.NamedTemporaryFile(
mode='wb', dir=os.fsdecode(self.temp_dir), suffix='.yaml',
mode='wb', dir=py3_path(self.temp_dir), suffix='.yaml',
delete=False)
config_file.write(
yaml.dump(config, Dumper=confit.Dumper, encoding='utf-8'))