diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 82dca29a61..d3a07f84bb 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -423,15 +423,15 @@ sub subdircheck
 
 		@opts = grep { $_ !~ /plpythonu/ } @opts;
 
-		if (-d "$topdir/$Config/plpython2")
+		if (-d "$topdir/$Config/plpython3")
 		{
-			push @opts, "--load-extension=plpythonu";
-			push @opts, '--load-extension=' . $module . 'u';
+			@tests = mangle_plpython3(\@tests);
 		}
-		else
+		elsif (-d "$topdir/$Config/plpython2")
 		{
-			# must be python 3
-			@tests = mangle_plpython3(\@tests);
+			# if python3 doesn't exist this isn't the stub module
+			push @opts, "--load-extension=plpythonu";
+			push @opts, '--load-extension=' . $module . 'u';
 		}
 	}
 
