File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -1116,11 +1116,15 @@ def test_behavior_with_bytes(): # type: () -> None
1116
1116
assert p1 / brelpath == local ("" ) / local ("bytesname" )
1117
1117
assert str (p1 / brelpath ) == str (local ("" ) / local ("bytesname" ))
1118
1118
else :
1119
- assert p1 / brelpath != local ("" ) / local ("bytesname" )
1120
- with pytest .raises (
1121
- TypeError , match = r"__str__ returned non-string \(type bytes\)"
1122
- ):
1123
- str (p1 / brelpath )
1119
+ if sys .platform == "win32" :
1120
+ pytest .raises (TypeError , "a bytes-like object is required, not 'str'" ):
1121
+ p1 / brelpath
1122
+ else :
1123
+ assert p1 / brelpath != local ("" ) / local ("bytesname" )
1124
+ with pytest .raises (
1125
+ TypeError , match = r"__str__ returned non-string \(type bytes\)"
1126
+ ):
1127
+ str (p1 / brelpath )
1124
1128
1125
1129
strpath = (p1 / brelpath ).strpath .decode ()
1126
1130
assert strpath == str (local ("" ) / local ("bytesname" ))
You can’t perform that action at this time.
0 commit comments