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