Skip to content
This repository
Browse code

Check for .pyd as extension for binary files.

Closes gh-497
  • Loading branch information...
commit 3902dd419107f14ca6afdfd6d67c0ed357a85224 1 parent 657504e
Thomas Kluyver takluyver authored

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. +1 1  IPython/core/
2  IPython/core/
@@ -549,7 +549,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
549 549 fname = inspect.getabsfile(obj.__class__)
550 550 if fname.endswith('<string>'):
551 551 fname = 'Dynamically generated function. No source code available.'
552   - if (fname.endswith('.so') or fname.endswith('.dll')):
  552 + if any(fname.endswith(e) for e in ['.so', '.dll', '.pyd']):
553 553 binary_file = True
554 554 out['file'] = fname
555 555 except:

5 comments on commit 3902dd4

Ilan Schnell

This can be simplified: "if fname.endswith(('.so', '.dll', '.pyd')):"

Fernando Perez

Thanks, Ilan! I had never noticed this form of endswith. Excellent. Worth noting that line 360 of the smae file has the same pattern also, so it should probably be fixed there too.

Thomas Kluyver

I didn't know about that, either. Thanks. I've updated both checks - see commit 29fa173.

Ilan Schnell

You're welcome. I just check this feature was added in Python 2.5, so it's OK because ipython does not support Python 2.4 anymore.

Thomas Kluyver

Yep, I checked that, too. In fact, for 0.11, we're only supporting Python 2.6 and above.

Please sign in to comment.
Something went wrong with that request. Please try again.