Skip to content

Commit

Permalink
Use ExitStack from python standard library. (pantsbuild#9645)
Browse files Browse the repository at this point in the history
### Problem

We have an external dependency that we don't need.

### Solution

This is the only (last?) place we were using contextlib2, the ExitStack class was added to the standard library in Python 3.3
https://docs.python.org/3/library/contextlib.html#contextlib.ExitStack

### Result
One less external dependency.
  • Loading branch information
asherf committed Apr 28, 2020
1 parent be5c63e commit 10f59e0
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion 3rdparty/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ansicolors==1.1.8
beautifulsoup4>=4.6.0,<4.7
cffi==1.13.2
contextlib2==0.5.5
coverage>=4.5,<4.6
dataclasses==0.6
docutils==0.14
Expand Down
1 change: 0 additions & 1 deletion src/python/pants/java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ python_library(
name = 'nailgun_io',
sources = ['nailgun_io.py'],
dependencies = [
'3rdparty/python:contextlib2',
':nailgun_protocol'
],
tags = {"partially_type_checked"},
Expand Down
4 changes: 1 addition & 3 deletions src/python/pants/java/nailgun_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
import os
import select
import threading
from contextlib import contextmanager

from contextlib2 import ExitStack
from contextlib import ExitStack, contextmanager

from pants.java.nailgun_protocol import ChunkType, NailgunProtocol

Expand Down

0 comments on commit 10f59e0

Please sign in to comment.