Mercurial > cpython-lru_cache-weakref
diff Lib/lib-tk/tkFileDialog.py @ 27069:ef531482bb37 legacy-trunk
Convert Tcl path objects to strings. Fixes #661357.
Provide .string attribute and __unicode for Tcl_Objs.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Sat, 04 Jan 2003 00:08:09 +0000 |
| parents | 6d35d4292dec |
| children | 1ab9978123be |
line wrap: on
line diff
--- a/Lib/lib-tk/tkFileDialog.py Fri Jan 03 22:35:24 2003 +0000 +++ b/Lib/lib-tk/tkFileDialog.py Sat Jan 04 00:08:09 2003 +0000 @@ -55,6 +55,12 @@ if result: # keep directory and filename until next time import os + # convert Tcl path objects to strings + try: + result = result.string + except AttributeError: + # it already is a string + pass path, file = os.path.split(result) self.options["initialdir"] = path self.options["initialfile"] = file
