Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
1858944e
Commit
1858944e
authored
Aug 21, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
linux parsing for lsof fix.
parent
794393f3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
src/greentest/greentest.py
src/greentest/greentest.py
+4
-3
No files found.
src/greentest/greentest.py
View file @
1858944e
...
@@ -659,11 +659,10 @@ def get_open_files(pipes=False):
...
@@ -659,11 +659,10 @@ def get_open_files(pipes=False):
continue
continue
split
=
re
.
split
(
r'\
s+
', line)
split
=
re
.
split
(
r'\
s+
', line)
command, pid, user, fd = split[:4]
command, pid, user, fd = split[:4]
# Pipes get an fd like "3" while normal files get an fd like "1u"
# Pipes
(on OS X, at least)
get an fd like "3" while normal files get an fd like "1u"
if fd[:-1].isdigit() or fd.isdigit():
if fd[:-1].isdigit() or fd.isdigit():
if not pipes and
not
fd[-1].isdigit():
if not pipes and fd[-1].isdigit():
continue
continue
print(fd)
fd = int(fd[:-1]) if not fd[-1].isdigit() else int(fd)
fd = int(fd[:-1]) if not fd[-1].isdigit() else int(fd)
if fd in results:
if fd in results:
params = (fd, line, split, results.get(fd), data)
params = (fd, line, split, results.get(fd), data)
...
@@ -690,6 +689,8 @@ lsof_get_open_files = get_open_files
...
@@ -690,6 +689,8 @@ lsof_get_open_files = get_open_files
try:
try:
import psutil
import psutil
except ImportError:
except ImportError:
pass
else:
# If psutil is available (it is cross-platform) use that.
# If psutil is available (it is cross-platform) use that.
# It is *much* faster than shelling out to lsof each time
# It is *much* faster than shelling out to lsof each time
# (Running 14 tests takes 3.964s with lsof and 0.046 with psutil)
# (Running 14 tests takes 3.964s with lsof and 0.046 with psutil)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment