1
0
mirror of https://github.com/gryf/ebook-converter.git synced 2026-02-27 04:35:58 +01:00

Removing polyglot getcwd and getenv

This commit is contained in:
2020-04-20 20:33:25 +02:00
parent c867f0321b
commit 3ca3f08054
29 changed files with 89 additions and 99 deletions

View File

@@ -9,7 +9,7 @@ import urllib.parse
from ebook_converter import relpath, guess_type, prints, force_unicode
from ebook_converter.utils.config_base import tweaks
from ebook_converter.polyglot.builtins import getcwd, iteritems, itervalues, as_unicode
from ebook_converter.polyglot.builtins import iteritems, itervalues, as_unicode
from ebook_converter.polyglot.urllib import unquote
@@ -225,7 +225,7 @@ class Resource(object):
'''
def __init__(self, href_or_path, basedir=getcwd(), is_path=True):
def __init__(self, href_or_path, basedir=os.getcwd(), is_path=True):
self._href = None
self._basedir = basedir
self.path = None
@@ -267,7 +267,7 @@ class Resource(object):
if self._basedir:
basedir = self._basedir
else:
basedir = getcwd()
basedir = os.getcwd()
if self.path is None:
return self._href
f = self.fragment.encode('utf-8') if isinstance(self.fragment, str) else self.fragment