Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Check for .pyd as extension for binary files. #498

Merged
merged 1 commit into from

4 participants

@takluyver
Owner

Closes gh-497

@klonuo

Works fine here, reverses to regular help (?)

@takluyver takluyver merged commit 3902dd4 into from
@takluyver
Owner

Merged without review because it's a one-line change, and it works.

@ilanschnell

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

Owner

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.

Owner

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

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.

Owner

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

@damianavila damianavila referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 2, 2011
  1. @takluyver
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  IPython/core/oinspect.py
View
2  IPython/core/oinspect.py
@@ -549,7 +549,7 @@ def info(self, obj, oname='', formatter=None, info=None, detail_level=0):
fname = inspect.getabsfile(obj.__class__)
if fname.endswith('<string>'):
fname = 'Dynamically generated function. No source code available.'
- if (fname.endswith('.so') or fname.endswith('.dll')):
+ if any(fname.endswith(e) for e in ['.so', '.dll', '.pyd']):
binary_file = True
out['file'] = fname
except:
Something went wrong with that request. Please try again.