diff --git a/setup.py b/setup.py index 6f06ad10..f155119d 100644 --- a/setup.py +++ b/setup.py @@ -387,10 +387,10 @@ or with the pg_config option in 'setup.cfg'. ) # Support unicode paths, if this version of Python provides the # necessary infrastructure: - if hasattr(sys, 'getfilesystemencoding'): + if sys.version_info[0] < 3 \ + and hasattr(sys, 'getfilesystemencoding'): pg_config_path = pg_config_path.encode( - sys.getfilesystemencoding() - ) + sys.getfilesystemencoding()) return pg_config_path