Skip to content

Commit c3292fd

Browse files
committed
Fixing test to not run on old version of Python. Style.
1 parent e8571fa commit c3292fd

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_string.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -897,7 +897,8 @@ def test_startswith(self):
897897
self.checkequal(False, 'helloworld', 'startswith', 'lowo', 3, 6)
898898
self.checkequal(True, '', 'startswith', '', 0, 1)
899899
self.checkequal(True, '', 'startswith', '', 0, 0)
900-
self.checkequal(False, '', 'startswith', '', 1, 0)
900+
if (sys.version_info.major >= 3 and sys.version_info.minor >= 6):
901+
self.checkequal(False, '', 'startswith', '', 1, 0)
901902

902903
# test negative indices
903904
self.checkequal(True, 'hello', 'startswith', 'he', 0, -1)

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str/StringBuiltins.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ boolean startsWith(String self, PTuple prefix, Object start, Object end) {
588588
}
589589

590590
@Fallback
591+
@SuppressWarnings("unused")
591592
boolean general(Object self, Object prefix, Object start, Object end) {
592593
throw raise(TypeError, "startswith first arg must be str or a tuple of str, not %p", prefix);
593594
}

0 commit comments

Comments
 (0)