Skip to content

Commit a6a573b

Browse files
stephenfinpriteau
authored andcommitted
Remove use of removeprefix
This is not supported on Python 3.8 [1]. I have no idea why this was not failing CI. [1] https://docs.python.org/3.9/library/stdtypes.html#str.removeprefix Change-Id: I225e9ced0f75c415b1d2fee05440291e3d8635c0 Signed-off-by: Stephen Finucane <[email protected]> (cherry picked from commit 3ccf82e)
1 parent dccdd0b commit a6a573b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

nova/tests/unit/console/test_websocketproxy.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,9 @@ def test_reject_open_redirect(self, url='//example.com/%2F..'):
635635
# now the same url but with extra leading '/' characters removed.
636636
if expected_cpython in errmsg:
637637
location = result[3].decode()
638-
location = location.removeprefix('Location: ').rstrip('\r\n')
638+
if location.startswith('Location: '):
639+
location = location[len('Location: '):]
640+
location = location.rstrip('\r\n')
639641
self.assertTrue(
640642
location.startswith('/example.com/%2F..'),
641643
msg='Redirect location is not the expected sanitized URL',

0 commit comments

Comments
 (0)