From dfe6341f72d687e6b14af0e7ac499dd26f4f7587 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Wed, 7 Feb 2018 15:17:05 +0100 Subject: [PATCH] WIP: fix the build of travis --- .travis.yml | 4 +++- Modules/_datetimemodule.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d7387e5f9831b2..4f3138a783e421 100644 --- a/.travis.yml +++ b/.travis.yml @@ -85,19 +85,21 @@ before_script: set -e if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then files_changed=$(git diff --name-only $TRAVIS_COMMIT_RANGE) + has_code=$(git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '(\.rst$)|(^Doc)|(^Misc)') else # Pull requests are slightly complicated because merging the PR commit without # rebasing causes it to retain its old commit date. Meaning in history if any # commits have been made on master that post-date it, they will be accidentally # included in the diff if we use the TRAVIS_COMMIT_RANGE variable. files_changed=$(git diff --name-only HEAD $(git merge-base HEAD $TRAVIS_BRANCH)) + has_code=$(git diff --name-only HEAD $(git merge-base HEAD $TRAVIS_BRANCH) | grep -qvE '(\.rst$)|(^Doc)|(^Misc)') fi # Prints changed files in this commit to help debug doc-only build issues. echo "Files changed: " echo $files_changed - if ! echo $files_changed | grep -qvE '(\.rst$)|(^Doc)|(^Misc)' + if ! $has_code then echo "Only docs were updated, stopping build process." exit diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c index b69fcdffcc920c..bb145931ada0b2 100644 --- a/Modules/_datetimemodule.c +++ b/Modules/_datetimemodule.c @@ -4775,6 +4775,7 @@ datetime_utcfromtimestamp(PyObject *cls, PyObject *args) static PyObject * datetime_strptime(PyObject *cls, PyObject *args) { + static PyObject *module = NULL; PyObject *string, *format; _Py_IDENTIFIER(_strptime_datetime);