File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -254,17 +254,18 @@ def __repr__(self):
254
254
self .type ,
255
255
self .proto )
256
256
if not closed :
257
+ # getsockname and getpeername may not be available on WASI.
257
258
try :
258
259
laddr = self .getsockname ()
259
260
if laddr :
260
261
s += ", laddr=%s" % str (laddr )
261
- except error :
262
+ except ( error , AttributeError ) :
262
263
pass
263
264
try :
264
265
raddr = self .getpeername ()
265
266
if raddr :
266
267
s += ", raddr=%s" % str (raddr )
267
- except error :
268
+ except ( error , AttributeError ) :
268
269
pass
269
270
s += '>'
270
271
return s
Original file line number Diff line number Diff line change
1
+ Work around missing socket functions in :class: `~socket.socket `'s
2
+ ``__repr__ ``.
Original file line number Diff line number Diff line change @@ -229,7 +229,8 @@ def main():
229
229
230
230
extmods = detect_extension_modules (args )
231
231
omit_files = list (OMIT_FILES )
232
- omit_files .extend (OMIT_NETWORKING_FILES )
232
+ if sysconfig .get_platform ().startswith ("emscripten" ):
233
+ omit_files .extend (OMIT_NETWORKING_FILES )
233
234
for modname , modfiles in OMIT_MODULE_FILES .items ():
234
235
if not extmods .get (modname ):
235
236
omit_files .extend (modfiles )
You can’t perform that action at this time.
0 commit comments