Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitafc28c3

Browse files
committed
Do not patch __loader__ if not available
1 parent84d581a commitafc28c3

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

‎bpython/curtsiesfrontend/repl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,14 @@ def find_distributions(self, context):
290290
deffind_spec(self,fullname,path,target=None):
291291
forfinderinself.old_meta_path:
292292
# Consider the finder only if it implements find_spec
293-
ifnotgetattr(finder,"find_spec",None):
293+
ifgetattr(finder,"find_spec",None)isNone:
294294
continue
295295
# Attempt to find the spec
296296
spec=finder.find_spec(fullname,path,target)
297297
ifspecisnotNone:
298-
# Patch the loader to enable reloading
299-
spec.__loader__=ImportLoader(self.watcher,spec.__loader__)
298+
ifgetattr(spec,"__loader__",None)isnotNone:
299+
# Patch the loader to enable reloading
300+
spec.__loader__=ImportLoader(self.watcher,spec.__loader__)
300301
returnspec
301302

302303
deffind_module(self,fullname,path=None):

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp