Repository navigation
Make stack_data optional, defer to old_ultratb if not present - #12054
alexmojaki wants to merge 11 commits into
Conversation
|
Oops, this was meant to be a PR into my PR, as in: alexmojaki#1 I'll delete this if you prefer. Anyway, you can see the idea either way. try:
import stack_data
except ImportError:
from .ultratb_old import *
else:
from .ultratb_new import *while This is in response to @Carreau saying:
and I'm trying to figure out the best way to implement that. I thought this would be pretty neat as it makes the switch seamless and keeps all imports of ultratb the same, but it completely destroys the git history and I don't see a way around that. I can't seem to get git to recognise any of this as a rename: $ git mv ultratb.py ultratb_new.py
$ git status
On branch stack-data-optional
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: ultratb.py -> ultratb_new.py
$ touch ultratb.py
$ git status
On branch stack-data-optional
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: ultratb.py -> ultratb_new.py
Untracked files:
(use "git add <file>..." to include in what will be committed)
ultratb.py
$ git add ultratb.py
$ git status
On branch stack-data-optional
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: ultratb.py
new file: ultratb_new.py
So maybe if we want to preserve history and git blame the three files should be:
Any thoughts? |
No description provided.