> # insert current working directory to the python path to have a > correct > # behaviour > - sys.path.insert(0, os.getcwd()) > + if len(args) == 1: > + sys.path.insert(0, self._get_python_path(args[0])) > + else: > + sys.path.insert(0, os.getcwd())
sys.path[0:0] = list(set(self._get_python_path(arg) for arg in args if not os.path.isfile(arg))) sys.path.insert(0, os.getcwd()) > + def _get_python_path(self, filepath): > + dirname = os.path.dirname(os.path.realpath( > + os.path.expanduser(filepath))) You can argue whether realpath(dirname(...)) is the better order, and whether realpath should be in there at all. Bye, Jürgen _______________________________________________ Python-Projects mailing list [email protected] http://lists.logilab.org/mailman/listinfo/python-projects
