Return arg in case of invalid param in strftime

Chrono panics in case of unsupported formats, this patch handles such
cases and returns supplied format as a result.
This commit is contained in:
Ankit Kumar Pandey
2023-02-20 20:41:04 +05:30
parent e5735cde67
commit fcfe8e1ac8
3 changed files with 18 additions and 2 deletions

View File

@@ -131,6 +131,11 @@ assert_raises(NotImplementedError, ne.tzname, dt)
assert_raises(NotImplementedError, ne.utcoffset, dt)
assert_raises(NotImplementedError, ne.dst, dt)
# unsupport format in strptime returns arg itself
# in linux. Todo: add cases for Mac/Windows
if sys.platform == 'linux':
assert_equal(_time.strftime("%?"), "%?")
# XXX: bug #1302
# def test_normal(self):
#fo = FixedOffset(3, "Three")