mirror of
https://github.com/ChristianLight/tutor.git
synced 2024-11-05 04:48:00 +00:00
Fix parsing of weird characters in configuration parameters
This commit is contained in:
parent
ae23637d76
commit
d4a429bcc5
@ -22,3 +22,6 @@ class SerializeTests(unittest.TestCase):
|
||||
|
||||
def test_parse_list(self):
|
||||
self.assertEqual(["abcd"], serialize.parse('["abcd"]'))
|
||||
|
||||
def test_parse_weird_chars(self):
|
||||
self.assertEqual("*@google.com", serialize.parse("*@google.com"))
|
||||
|
@ -1,5 +1,6 @@
|
||||
import yaml
|
||||
from yaml.parser import ParserError
|
||||
from yaml.scanner import ScannerError
|
||||
|
||||
|
||||
def load(stream):
|
||||
@ -16,6 +17,6 @@ def parse(v):
|
||||
"""
|
||||
try:
|
||||
return load(v)
|
||||
except ParserError:
|
||||
except (ParserError, ScannerError):
|
||||
pass
|
||||
return v
|
||||
|
Loading…
Reference in New Issue
Block a user