timothycrosley / deprecated.pies

The simplest (and tastiest) way to write one program that runs on both Python 2 and Python 3.
MIT License
148 stars 7 forks source link

sys module reloading causes stdout/stderr customization to be reset #30

Closed char101 closed 9 years ago

char101 commented 10 years ago

Hi,

So I was using vim with the vim-flake8 plugin, which in turn uses frosted, which in turn uses pies.

When python is run inside vim, the sys.stdout/sys.stderr is assigned to the vim window, but when the module is being reloaded, the assignment is gone.

https://github.com/timothycrosley/pies/blob/develop/pies/overrides.py#L101

Is this reload really necessary?

char101 commented 10 years ago

Apparently it is necessary. Is is possible the save and restore the stdout/stderr before/after reloading the sys module?

timothycrosley commented 9 years ago

Hi @char101,

Thanks for reporting this issue! I'll try to have a fix of some sort in before the next release.

Thanks!

~Timothy

timothycrosley commented 9 years ago

Hi @char101,

This fix is live in version 2.6.3

Thanks again!

~Timothy

char101 commented 9 years ago

Thanks for fixing the issue.