Thanks, that makes sense. Well, it's completely weird from a programming
standpoint, but once explained, I can see where it might be useful.

--Paul Hoffman

On Wed, Sep 30, 2015 at 2:48 PM, Peter Sanchez <[email protected]> wrote:

> Yes. It's expected. Fabric doesn't evaluate the context until a fabric
> "command" is actually run. See:
>
>
> https://github.com/fabric/fabric/blob/master/fabric/context_managers.py#L309
>
>
>
> On Tue, Sep 29, 2015 at 11:14 AM, Paul Hoffman <[email protected]>
> wrote:
>
>> ...but maybe it is just me.
>>
>> print(os.getcwd())
>> with lcd("/usr/bin"):
>>   print(os.getcwd())
>>
>> ...prints the same location name twice, and it is clear that the cd
>> didn't happen.
>>
>> print(os.getcwd())
>> with lcd("/does/not/exist"):
>>   print(os.getcwd())
>>
>> ...prints the same location name twice. lcd doesn't throw an error, which
>> I would have thought it would.
>>
>> Is this what is expected?
>>
>> --Paul Hoffman
>>
>> _______________________________________________
>> Fab-user mailing list
>> [email protected]
>> https://lists.nongnu.org/mailman/listinfo/fab-user
>>
>>
>
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to