Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ai
sso
Commits
97091992
Commit
97091992
authored
10 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
call isatty() on the file handle
parent
0df31d32
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/python/sso/urllib2_handler.py
+1
-2
1 addition, 2 deletions
src/python/sso/urllib2_handler.py
with
1 addition
and
2 deletions
src/python/sso/urllib2_handler.py
+
1
−
2
View file @
97091992
import
cookielib
import
cookielib
import
getpass
import
getpass
import
os
import
urllib2
import
urllib2
import
urllib
import
urllib
import
re
import
re
...
@@ -44,7 +43,7 @@ class SSOProcessor(urllib2.BaseHandler):
...
@@ -44,7 +43,7 @@ class SSOProcessor(urllib2.BaseHandler):
if
self
.
_otp_pattern
.
search
(
response_data
):
if
self
.
_otp_pattern
.
search
(
response_data
):
# Only ask for an OTP when the standard input is a tty,
# Only ask for an OTP when the standard input is a tty,
# otherwise simply don't send any OTP.
# otherwise simply don't send any OTP.
if
os
.
isatty
(
sys
.
stdin
):
if
sys
.
stdin
.
isatty
(
):
form_data
[
'
otp
'
]
=
raw_input
(
'
OTP for %s@%s:
'
%
(
form_data
[
'
otp
'
]
=
raw_input
(
'
OTP for %s@%s:
'
%
(
self
.
_username
,
form_data
[
'
s
'
].
rstrip
(
'
/
'
)))
self
.
_username
,
form_data
[
'
s
'
].
rstrip
(
'
/
'
)))
newreq
=
urllib2
.
Request
(
request_baseurl
,
newreq
=
urllib2
.
Request
(
request_baseurl
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment