Re: pgsql: Skip \password TAP test on old IPC::Run versions

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: pgsql: Skip \password TAP test on old IPC::Run versions
Дата
Msg-id e5262673-8958-298a-faba-d25c79dd9807@dunslane.net
обсуждение исходный текст
Ответ на Re: pgsql: Skip \password TAP test on old IPC::Run versions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-committers


On 2023-04-08 Sa 16:30, Tom Lane wrote:
Daniel Gustafsson <daniel@yesql.se> writes:
On 8 Apr 2023, at 18:23, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Can't we write "use IPC::Run 0.98;" and let
some other code manage the version comparison?
We can, but that AFAIK (Andrew might have a better answer) requires the below
diff which I think leaves some readability to be desired:
-   (eval { require IO::Pty; } && eval { $IPC::Run::VERSION >= '0.98' });
+   (eval { require IO::Pty; } && !!eval { IPC::Run->VERSION('0.98'); 1 });
Maybe I'm missing something, but I was envisioning
	eval { require IO::Pty; use IPC::Run 0.98; }

with no need to do more than check if the eval traps an error.
			

You need to be careful with "use". It is executed in the compile phase, so I'd avoid it here.


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

В списке pgsql-committers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: pgsql: Skip \password TAP test on old IPC::Run versions
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: pgsql: Skip \password TAP test on old IPC::Run versions