diff i18n/polib.py @ 52675:b95b12cb31e2

pyupgrade: replace `io.open()` with `open()` This was rewritten by the `io_open` fixer in `pyupgrade`.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 06 Jan 2025 01:27:42 -0500
parents 5cc8deb96b48
children f19a3f1437f3
line wrap: on
line diff
--- a/i18n/polib.py	Mon Jan 06 01:20:01 2025 -0500
+++ b/i18n/polib.py	Mon Jan 06 01:27:42 2025 -0500
@@ -466,7 +466,7 @@
         if repr_method == 'to_binary':
             fhandle = open(fpath, 'wb')
         else:
-            fhandle = io.open(fpath, 'w', encoding=self.encoding)
+            fhandle = open(fpath, 'w', encoding=self.encoding)
             if not isinstance(contents, text_type):
                 contents = contents.decode(self.encoding)
         fhandle.write(contents)
@@ -1253,10 +1253,10 @@
         enc = kwargs.get('encoding', default_encoding)
         if _is_file(pofile):
             try:
-                self.fhandle = io.open(pofile, 'rt', encoding=enc)
+                self.fhandle = open(pofile, 'rt', encoding=enc)
             except LookupError:
                 enc = default_encoding
-                self.fhandle = io.open(pofile, 'rt', encoding=enc)
+                self.fhandle = open(pofile, 'rt', encoding=enc)
         else:
             self.fhandle = pofile.splitlines()