diff options
| author | 2018-03-14 02:56:04 +0100 | |
|---|---|---|
| committer | 2018-03-14 20:23:00 -0400 | |
| commit | 23ac25c0b388b5ffebf66154b12a3950b89b977a (patch) | |
| tree | 27ae214e393e6be2efc225d02ffc93135aaa2eb5 /minidinstall/DpkgDatalist.py | |
| parent | 9883708468224628f9e0e577162fb5345fe20eb4 (diff) | |
Port to Python 3
Diffstat (limited to 'minidinstall/DpkgDatalist.py')
| -rw-r--r-- | minidinstall/DpkgDatalist.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/minidinstall/DpkgDatalist.py b/minidinstall/DpkgDatalist.py index 0c11612..68f9940 100644 --- a/minidinstall/DpkgDatalist.py +++ b/minidinstall/DpkgDatalist.py @@ -21,10 +21,9 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os, sys -from UserDict import UserDict -from OrderedDict import OrderedDict +from collections import UserDict +from collections import OrderedDict from minidinstall.SafeWriteFile import SafeWriteFile -from types import StringType class DpkgDatalistException(Exception): UNKNOWN = 0 @@ -55,15 +54,14 @@ class _DpkgDatalist: self._store(sys.stdout) return - # Write to a temporary file first - if type(fn) == StringType: + if isinstance(fn, str): vf=SafeWriteFile(fn+".new", fn, "w") else: vf=fn try: self._store(vf) finally: - if type(fn) == StringType: + if isinstance(fn, str): vf.close() |
