mirror of
https://github.com/micropython/micropython.git
synced 2025-12-26 23:00:16 +01:00
MP_OBJ_SMALL_INT_VALUE would give erroneous results, such as assertion
failures in the coverage build and other oddities like:
>>> s = socket.socket()
>>> s.recv(3.14)
MemoryError: memory allocation failed, allocating 4235896656 bytes
Signed-off-by: Jeff Epler <jepler@gmail.com>
23 lines
404 B
Python
23 lines
404 B
Python
# Test passing in bad values to socket.socket constructor.
|
|
|
|
try:
|
|
import socket
|
|
except:
|
|
print("SKIP")
|
|
raise SystemExit
|
|
|
|
try:
|
|
s = socket.socket(None)
|
|
except TypeError:
|
|
print("TypeError")
|
|
|
|
try:
|
|
s = socket.socket(socket.AF_INET, None)
|
|
except TypeError:
|
|
print("TypeError")
|
|
|
|
try:
|
|
s = socket.socket(socket.AF_INET, socket.SOCK_RAW, None)
|
|
except TypeError:
|
|
print("TypeError")
|