diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index fd3c63de1e72..f601fbc98085 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -162,7 +162,8 @@ in stdenv.mkDerivation { # needed for some packages, especially packages that backport # functionality to 2.x from 3.x for item in $out/lib/python${majorVersion}/test/*; do - if [[ "$item" != */test_support.py* ]]; then + if [[ "$item" != */test_support.py* + && "$item" != */regrtest.py* ]]; then rm -rf "$item" else echo $item diff --git a/pkgs/development/interpreters/python/cpython/3.4/default.nix b/pkgs/development/interpreters/python/cpython/3.4/default.nix index d00b91f316ff..3b375e147bce 100644 --- a/pkgs/development/interpreters/python/cpython/3.4/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.4/default.nix @@ -111,7 +111,10 @@ in stdenv.mkDerivation { # needed for some packages, especially packages that backport functionality # to 2.x from 3.x for item in $out/lib/python${majorVersion}/test/*; do - if [[ "$item" != */test_support.py* ]]; then + if [[ "$item" != */test_support.py* + && "$item" != */test/support + && "$item" != */test/libregrtest + && "$item" != */test/regrtest.py* ]]; then rm -rf "$item" else echo $item diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 1b71dba42c41..ed1170427c0a 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -105,7 +105,10 @@ in stdenv.mkDerivation { # needed for some packages, especially packages that backport functionality # to 2.x from 3.x for item in $out/lib/python${majorVersion}/test/*; do - if [[ "$item" != */test_support.py* ]]; then + if [[ "$item" != */test_support.py* + && "$item" != */test/support + && "$item" != */test/libregrtest + && "$item" != */test/regrtest.py* ]]; then rm -rf "$item" else echo $item diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index 0b0f9c8be6ab..127c093501c3 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -105,7 +105,10 @@ in stdenv.mkDerivation { # needed for some packages, especially packages that backport functionality # to 2.x from 3.x for item in $out/lib/python${majorVersion}/test/*; do - if [[ "$item" != */test_support.py* ]]; then + if [[ "$item" != */test_support.py* + && "$item" != */test/support + && "$item" != */test/libregrtest + && "$item" != */test/regrtest.py* ]]; then rm -rf "$item" else echo $item