In case filepath is a symlink, follow it until a real file is reached.
(filepath)
| 656 | return default |
| 657 | |
| 658 | def _follow_symlinks(filepath): |
| 659 | |
| 660 | """ In case filepath is a symlink, follow it until a |
| 661 | real file is reached. |
| 662 | """ |
| 663 | filepath = os.path.abspath(filepath) |
| 664 | while os.path.islink(filepath): |
| 665 | filepath = os.path.normpath( |
| 666 | os.path.join(os.path.dirname(filepath), os.readlink(filepath))) |
| 667 | return filepath |
| 668 | |
| 669 | |
| 670 | def _syscmd_file(target, default=''): |