Show More
@@ -370,4 +370,7 b' class hgwebdir(object):' | |||||
370 | env['SERVER_NAME'] = u.host |
|
370 | env['SERVER_NAME'] = u.host | |
371 | if u.port: |
|
371 | if u.port: | |
372 | env['SERVER_PORT'] = u.port |
|
372 | env['SERVER_PORT'] = u.port | |
373 | env['SCRIPT_NAME'] = '/' + u.path |
|
373 | path = u.path or "" | |
|
374 | if not path.startswith('/'): | |||
|
375 | path = '/' + path | |||
|
376 | env['SCRIPT_NAME'] = path |
@@ -539,12 +539,15 b' class ui(object):' | |||||
539 | except Exception: |
|
539 | except Exception: | |
540 | pass |
|
540 | pass | |
541 |
|
541 | |||
542 | # instead of trying to emulate raw_input, swap our in/out |
|
542 | # call write() so output goes through subclassed implementation | |
543 | # with sys.stdin/out |
|
543 | # e.g. color extension on Windows | |
544 | old = sys.stdout, sys.stdin |
|
544 | self.write(prompt) | |
545 | sys.stdout, sys.stdin = self.fout, self.fin |
|
545 | ||
546 | line = raw_input(prompt) |
|
546 | # instead of trying to emulate raw_input, swap self.fin with sys.stdin | |
547 |
|
|
547 | old = sys.stdin | |
|
548 | sys.stdin = self.fin | |||
|
549 | line = raw_input() | |||
|
550 | sys.stdin = old | |||
548 |
|
551 | |||
549 | # When stdin is in binary mode on Windows, it can cause |
|
552 | # When stdin is in binary mode on Windows, it can cause | |
550 | # raw_input() to emit an extra trailing carriage return |
|
553 | # raw_input() to emit an extra trailing carriage return |
General Comments 0
You need to be logged in to leave comments.
Login now