Skip to content

Instantly share code, notes, and snippets.

python develop-inst-nodeps: /Users/jaraco/Dropbox/code/main/jaraco.itertools
python installed: attrs==17.4.0,collective.checkdocs==0.2,docutils==0.14,inflect==0.2.5,-e git+gh://jaraco/jaraco.itertools@3a3d73e7def3403e067c5c715da9529a35b1c378#egg=jaraco.itertools,more-itertools==4.1.0,pluggy==0.6.0,py==1.5.2,pytest==3.4.1,pytest-sugar==0.9.1,six==1.11.0,termcolor==1.1.0
python runtests: PYTHONHASHSEED='3026495925'
python runtests: commands[0] | py.test
============================= test session starts ==============================
platform darwin -- Python 3.7.0b2, pytest-3.4.1, py-1.5.2, pluggy-0.6.0
rootdir: /Users/jaraco/Dropbox/code/main/jaraco.itertools, inifile: pytest.ini
plugins: sugar-0.9.1
collected 32 items
$ tox -e py36
py36 create: /Users/jaraco/Dropbox/code/main/setuptools/.tox/py36
py36 installdeps: -rtests/requirements.txt
py36 develop-inst: /Users/jaraco/Dropbox/code/main/setuptools
py36 installed: apipkg==1.4,attrs==17.4.0,contextlib2==0.5.5,execnet==1.5.0,flake8==3.5.0,mccabe==0.6.1,mock==2.0.0,path.py==11.0,pbr==3.1.1,pluggy==0.6.0,py==1.5.2,pycodestyle==2.3.1,pyflakes==1.6.0,pytest==3.4.1,pytest-fixture-config==1.2.11,pytest-flake8==0.9.1,pytest-shutil==1.2.11,pytest-virtualenv==1.2.11,six==1.11.0,virtualenv==15.1.0
py36 runtests: PYTHONHASHSEED='1006593311'
py36 runtests: commands[0] | py.test
=============================================================================== test session starts ===============================================================================
platform darwin -- Python 3.6.4, pytest-3.4.1, py-1.5.2, pluggy-0.6.0
rootdir: /Users/jaraco/Dropbox/code/main/setuptools, inifile: pytest.ini
diff --git a/Lib/inspect.py b/Lib/inspect.py
index bc97efe179..d629689654 100644
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -642,13 +642,13 @@ def cleandoc(doc):
def getfile(object):
"""Work out which source or compiled file an object was defined in."""
if ismodule(object):
- if hasattr(object, '__file__'):
+ if getattr(object, '__file__', None):
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 5ad94aba64..6b7479bb51 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -7,6 +7,8 @@ import doctest
import functools
import os
import sys
+import importlib
+import unittest
$ git diff
diff --git a/Lib/test/test_doctest.py b/Lib/test/test_doctest.py
index 5ad94aba64..9851661d88 100644
--- a/Lib/test/test_doctest.py
+++ b/Lib/test/test_doctest.py
@@ -7,6 +7,7 @@ import doctest
import functools
import os
import sys
+import importlib
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'canary',
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',
https://gist.github.com/1a2cf7c28897f6dfd539b0e742a7e4d8
https://gist.github.com/1a2cf7c28897f6dfd539b0e742a7e4d8
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
updateChannel: 'stable',