Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
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
nexedi
re6stnet
Commits
267823ce
Commit
267823ce
authored
Oct 10, 2024
by
Thomas Gambier
🚴🏼
Committed by
Julien Muchembled
Oct 21, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various fixups for Python 3
parent
e80ca878
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
21 deletions
+8
-21
re6st/ctl.py
re6st/ctl.py
+1
-1
re6st/utils.py
re6st/utils.py
+5
-12
re6st/version.py
re6st/version.py
+2
-8
No files found.
re6st/ctl.py
View file @
267823ce
...
...
@@ -252,7 +252,7 @@ class Babel:
unidentified
=
set
(
n
)
self
.
neighbours
=
neighbours
=
{}
a
=
len
(
self
.
network
)
logging
.
info
(
"Routes: %r"
,
routes
)
logging
.
debug
(
"Routes: %r"
,
routes
)
for
route
in
routes
:
assert
route
.
flags
&
1
,
route
# installed
if
route
.
prefix
.
startswith
(
b'
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
0
\
xff
\
xff
'
):
...
...
re6st/utils.py
View file @
267823ce
...
...
@@ -8,15 +8,6 @@ HMAC_LEN = len(hashlib.sha1(b'').digest())
class
ReexecException
(
Exception
):
pass
try
:
subprocess
.
CalledProcessError
(
0
,
''
,
''
)
except
TypeError
:
# BBB: Python < 2.7
def
__init__
(
self
,
returncode
,
cmd
,
output
=
None
):
self
.
returncode
=
returncode
self
.
cmd
=
cmd
self
.
output
=
output
subprocess
.
CalledProcessError
.
__init__
=
__init__
logging_levels
=
logging
.
WARNING
,
logging
.
INFO
,
logging
.
DEBUG
,
5
class
FileHandler
(
logging
.
FileHandler
):
...
...
@@ -167,17 +158,19 @@ class Popen(subprocess.Popen):
def
send_signal
(
self
,
sig
):
logging
.
info
(
'Sending signal %s to pid %s %r'
,
sig
,
self
.
pid
,
self
.
_args
)
super
(
Popen
,
self
).
send_signal
(
sig
)
# We don't need the change from https://bugs.python.org/issue38630
# and it would complicate stop()
assert
self
.
returncode
is
None
os
.
kill
(
self
.
pid
,
sig
)
def
stop
(
self
):
if
self
.
pid
and
self
.
returncode
is
None
:
self
.
terminate
()
t
=
threading
.
Timer
(
5
,
self
.
kill
)
t
.
start
()
r
=
os
.
waitid
(
os
.
P_PID
,
self
.
pid
,
os
.
WNOWAIT
)
os
.
waitid
(
os
.
P_PID
,
self
.
pid
,
os
.
WEXITED
|
os
.
WNOWAIT
)
t
.
cancel
()
self
.
poll
()
return
r
def
setCloexec
(
fd
):
...
...
re6st/version.py
View file @
267823ce
...
...
@@ -6,15 +6,9 @@ def _git_call(*args):
return
_S
.
call
((
"git"
,
"-c"
,
"safe.directory="
+
_d
)
+
args
,
cwd
=
_d
)
def
_git_output
(
*
args
):
p
=
_S
.
Popen
(
return
_S
.
check_output
(
(
"git"
,
"-c"
,
"safe.directory="
+
_d
)
+
args
,
cwd
=
_d
,
stdout
=
_S
.
PIPE
,
stderr
=
_S
.
PIPE
)
out
,
err
=
p
.
communicate
()
if
p
.
returncode
:
raise
_S
.
CalledProcessError
(
p
.
returncode
,
"git"
,
err
)
return
out
.
strip
()
cwd
=
_d
,
text
=
True
).
strip
()
_git_call
(
"update-index"
,
"-q"
,
"--refresh"
)
dirty
=
_git_call
(
"diff-index"
,
"--quiet"
,
"HEAD"
,
"--"
)
...
...
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