Skip to content

Commit

Permalink
Fix deprecation warning for rU mode (#956)
Browse files Browse the repository at this point in the history
Closes #942.
  • Loading branch information
Eric-Arellano committed Apr 16, 2020
1 parent 6cf7d47 commit d628bd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pex/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from site import makepath

from pex.common import atomic_directory, safe_mkdir, safe_mkdtemp
from pex.compatibility import exec_function
from pex.compatibility import PY2, exec_function
from pex.third_party.pkg_resources import (
find_distributions,
resource_isdir,
Expand Down Expand Up @@ -175,9 +175,9 @@ def named_temporary_file(*args, **kwargs):

def iter_pth_paths(filename):
"""Given a .pth file, extract and yield all inner paths without honoring imports. This shadows
python's site.py behavior, which is invoked at interpreter startup."""
Python's site.py behavior, which is invoked at interpreter startup."""
try:
f = open(filename, 'rU') # noqa
f = open(filename, 'rU' if PY2 else 'r') # noqa
except IOError:
return

Expand Down

0 comments on commit d628bd6

Please sign in to comment.