mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
17 lines
390 B
Python
17 lines
390 B
Python
import zlib
|
|
try:
|
|
zlib.compress("This should cause a TypeError because it's a str not bytes")
|
|
except:
|
|
print("TypeError")
|
|
|
|
try:
|
|
zlib.decompress("This should also cause a TypeError because it's a str not bytes")
|
|
except:
|
|
print("TypeError")
|
|
|
|
try:
|
|
zlib.decompress(b"This should cause a zlib.error because it's not valid zlib compressed data")
|
|
except:
|
|
print("zlib.error")
|
|
|