@@ -96,10 +96,10 @@ TPyCustomEnvironment = class(TComponent, IEnvironmentNotifier<TPyCustomEnviron
9696 constructor Create(AOwner: TComponent); override;
9797 destructor Destroy(); override;
9898
99- procedure Setup (APythonVersion: string);
100- function SetupAsync (APythonVersion: string): ITask;
99+ procedure Setup (APythonVersion: string = ' ' );
100+ function SetupAsync (APythonVersion: string = ' ' ): ITask;
101101
102- function Activate (APythonVersion: string): boolean;
102+ function Activate (APythonVersion: string = ' ' ): boolean;
103103 procedure Deactivate ();
104104 public
105105 property Distributions: TPyDistributionCollection read FDistributions write SetEnvironments;
@@ -131,8 +131,8 @@ TPyEnvironment = class(TPyCustomEnvironment)
131131implementation
132132
133133uses
134+ System.IOUtils, System.StrUtils,
134135 TypInfo,
135- System.IOUtils,
136136 PyEnvironment.Path;
137137
138138{ TPyCustomEnvironment }
@@ -173,19 +173,22 @@ procedure TPyCustomEnvironment.Notification(AComponent: TComponent;
173173
174174procedure TPyCustomEnvironment.Setup (APythonVersion: string);
175175begin
176- InternalSetup(APythonVersion);
176+ InternalSetup(
177+ IfThen(APythonVersion.IsEmpty(), PythonVersion, APythonVersion));
177178end ;
178179
179180function TPyCustomEnvironment.SetupAsync (APythonVersion: string): ITask;
180181begin
181182 Result := TTask.Run(procedure() begin
182- InternalSetup(APythonVersion);
183+ InternalSetup(
184+ IfThen(APythonVersion.IsEmpty(), PythonVersion, APythonVersion));
183185 end );
184186end ;
185187
186188function TPyCustomEnvironment.Activate (APythonVersion: string): boolean;
187189begin
188- Result := InternalActivate(APythonVersion);
190+ Result := InternalActivate(
191+ IfThen(APythonVersion.IsEmpty(), PythonVersion, APythonVersion));
189192end ;
190193
191194procedure TPyCustomEnvironment.Deactivate ;
0 commit comments