Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
10ff706e
Kaydet (Commit)
10ff706e
authored
Haz 02, 2002
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Replaced boolean tests with is None.
üst
f13eb55d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
telnetlib.py
Lib/telnetlib.py
+1
-1
traceback.py
Lib/traceback.py
+5
-5
urllib.py
Lib/urllib.py
+5
-5
webbrowser.py
Lib/webbrowser.py
+1
-1
xmlrpclib.py
Lib/xmlrpclib.py
+2
-2
No files found.
Lib/telnetlib.py
Dosyayı görüntüle @
10ff706e
...
@@ -186,7 +186,7 @@ class Telnet:
...
@@ -186,7 +186,7 @@ class Telnet:
self
.
cookedq
=
''
self
.
cookedq
=
''
self
.
eof
=
0
self
.
eof
=
0
self
.
option_callback
=
None
self
.
option_callback
=
None
if
host
:
if
host
is
not
None
:
self
.
open
(
host
,
port
)
self
.
open
(
host
,
port
)
def
open
(
self
,
host
,
port
=
0
):
def
open
(
self
,
host
,
port
=
0
):
...
...
Lib/traceback.py
Dosyayı görüntüle @
10ff706e
...
@@ -16,7 +16,7 @@ def _print(file, str='', terminator='\n'):
...
@@ -16,7 +16,7 @@ def _print(file, str='', terminator='\n'):
def
print_list
(
extracted_list
,
file
=
None
):
def
print_list
(
extracted_list
,
file
=
None
):
"""Print the list of tuples as returned by extract_tb() or
"""Print the list of tuples as returned by extract_tb() or
extract_stack() as a formatted stack trace to the given file."""
extract_stack() as a formatted stack trace to the given file."""
if
not
fil
e
:
if
file
is
Non
e
:
file
=
sys
.
stderr
file
=
sys
.
stderr
for
filename
,
lineno
,
name
,
line
in
extracted_list
:
for
filename
,
lineno
,
name
,
line
in
extracted_list
:
_print
(
file
,
_print
(
file
,
...
@@ -51,7 +51,7 @@ def print_tb(tb, limit=None, file=None):
...
@@ -51,7 +51,7 @@ def print_tb(tb, limit=None, file=None):
'file' should be an open file or file-like object with a write()
'file' should be an open file or file-like object with a write()
method.
method.
"""
"""
if
not
fil
e
:
if
file
is
Non
e
:
file
=
sys
.
stderr
file
=
sys
.
stderr
if
limit
is
None
:
if
limit
is
None
:
if
hasattr
(
sys
,
'tracebacklimit'
):
if
hasattr
(
sys
,
'tracebacklimit'
):
...
@@ -116,7 +116,7 @@ def print_exception(etype, value, tb, limit=None, file=None):
...
@@ -116,7 +116,7 @@ def print_exception(etype, value, tb, limit=None, file=None):
occurred with a caret on the next line indicating the approximate
occurred with a caret on the next line indicating the approximate
position of the error.
position of the error.
"""
"""
if
not
fil
e
:
if
file
is
Non
e
:
file
=
sys
.
stderr
file
=
sys
.
stderr
if
tb
:
if
tb
:
_print
(
file
,
'Traceback (most recent call last):'
)
_print
(
file
,
'Traceback (most recent call last):'
)
...
@@ -203,7 +203,7 @@ def print_exc(limit=None, file=None):
...
@@ -203,7 +203,7 @@ def print_exc(limit=None, file=None):
"""Shorthand for 'print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit, file)'.
"""Shorthand for 'print_exception(sys.exc_type, sys.exc_value, sys.exc_traceback, limit, file)'.
(In fact, it uses sys.exc_info() to retrieve the same information
(In fact, it uses sys.exc_info() to retrieve the same information
in a thread-safe way.)"""
in a thread-safe way.)"""
if
not
fil
e
:
if
file
is
Non
e
:
file
=
sys
.
stderr
file
=
sys
.
stderr
try
:
try
:
etype
,
value
,
tb
=
sys
.
exc_info
()
etype
,
value
,
tb
=
sys
.
exc_info
()
...
@@ -214,7 +214,7 @@ def print_exc(limit=None, file=None):
...
@@ -214,7 +214,7 @@ def print_exc(limit=None, file=None):
def
print_last
(
limit
=
None
,
file
=
None
):
def
print_last
(
limit
=
None
,
file
=
None
):
"""This is a shorthand for 'print_exception(sys.last_type,
"""This is a shorthand for 'print_exception(sys.last_type,
sys.last_value, sys.last_traceback, limit, file)'."""
sys.last_value, sys.last_traceback, limit, file)'."""
if
not
fil
e
:
if
file
is
Non
e
:
file
=
sys
.
stderr
file
=
sys
.
stderr
print_exception
(
sys
.
last_type
,
sys
.
last_value
,
sys
.
last_traceback
,
print_exception
(
sys
.
last_type
,
sys
.
last_value
,
sys
.
last_traceback
,
limit
,
file
)
limit
,
file
)
...
...
Lib/urllib.py
Dosyayı görüntüle @
10ff706e
...
@@ -203,7 +203,7 @@ class URLopener:
...
@@ -203,7 +203,7 @@ class URLopener:
if
self
.
tempcache
and
url
in
self
.
tempcache
:
if
self
.
tempcache
and
url
in
self
.
tempcache
:
return
self
.
tempcache
[
url
]
return
self
.
tempcache
[
url
]
type
,
url1
=
splittype
(
url
)
type
,
url1
=
splittype
(
url
)
if
not
filenam
e
and
(
not
type
or
type
==
'file'
):
if
filename
is
Non
e
and
(
not
type
or
type
==
'file'
):
try
:
try
:
fp
=
self
.
open_local_file
(
url1
)
fp
=
self
.
open_local_file
(
url1
)
hdrs
=
fp
.
info
()
hdrs
=
fp
.
info
()
...
@@ -662,7 +662,7 @@ _localhost = None
...
@@ -662,7 +662,7 @@ _localhost = None
def
localhost
():
def
localhost
():
"""Return the IP address of the magic hostname 'localhost'."""
"""Return the IP address of the magic hostname 'localhost'."""
global
_localhost
global
_localhost
if
not
_localhost
:
if
_localhost
is
None
:
_localhost
=
socket
.
gethostbyname
(
'localhost'
)
_localhost
=
socket
.
gethostbyname
(
'localhost'
)
return
_localhost
return
_localhost
...
@@ -670,7 +670,7 @@ _thishost = None
...
@@ -670,7 +670,7 @@ _thishost = None
def
thishost
():
def
thishost
():
"""Return the IP address of the current host."""
"""Return the IP address of the current host."""
global
_thishost
global
_thishost
if
not
_thishost
:
if
_thishost
is
None
:
_thishost
=
socket
.
gethostbyname
(
socket
.
gethostname
())
_thishost
=
socket
.
gethostbyname
(
socket
.
gethostname
())
return
_thishost
return
_thishost
...
@@ -678,7 +678,7 @@ _ftperrors = None
...
@@ -678,7 +678,7 @@ _ftperrors = None
def
ftperrors
():
def
ftperrors
():
"""Return the set of errors raised by the FTP class."""
"""Return the set of errors raised by the FTP class."""
global
_ftperrors
global
_ftperrors
if
not
_ftperrors
:
if
_ftperrors
is
None
:
import
ftplib
import
ftplib
_ftperrors
=
ftplib
.
all_errors
_ftperrors
=
ftplib
.
all_errors
return
_ftperrors
return
_ftperrors
...
@@ -687,7 +687,7 @@ _noheaders = None
...
@@ -687,7 +687,7 @@ _noheaders = None
def
noheaders
():
def
noheaders
():
"""Return an empty mimetools.Message object."""
"""Return an empty mimetools.Message object."""
global
_noheaders
global
_noheaders
if
not
_noheaders
:
if
_noheaders
is
None
:
import
mimetools
import
mimetools
import
StringIO
import
StringIO
_noheaders
=
mimetools
.
Message
(
StringIO
.
StringIO
(),
0
)
_noheaders
=
mimetools
.
Message
(
StringIO
.
StringIO
(),
0
)
...
...
Lib/webbrowser.py
Dosyayı görüntüle @
10ff706e
...
@@ -17,7 +17,7 @@ def register(name, klass, instance=None):
...
@@ -17,7 +17,7 @@ def register(name, klass, instance=None):
def
get
(
using
=
None
):
def
get
(
using
=
None
):
"""Return a browser launcher instance appropriate for the environment."""
"""Return a browser launcher instance appropriate for the environment."""
if
using
:
if
using
is
not
None
:
alternatives
=
[
using
]
alternatives
=
[
using
]
else
:
else
:
alternatives
=
_tryorder
alternatives
=
_tryorder
...
...
Lib/xmlrpclib.py
Dosyayı görüntüle @
10ff706e
...
@@ -755,7 +755,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None):
...
@@ -755,7 +755,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None):
elif
methodresponse
and
isinstance
(
params
,
TupleType
):
elif
methodresponse
and
isinstance
(
params
,
TupleType
):
assert
len
(
params
)
==
1
,
"response tuple must be a singleton"
assert
len
(
params
)
==
1
,
"response tuple must be a singleton"
if
not
encoding
:
if
encoding
is
None
:
encoding
=
"utf-8"
encoding
=
"utf-8"
m
=
Marshaller
(
encoding
)
m
=
Marshaller
(
encoding
)
...
@@ -767,7 +767,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None):
...
@@ -767,7 +767,7 @@ def dumps(params, methodname=None, methodresponse=None, encoding=None):
xmlheader
=
"<?xml version='1.0'?>
\n
"
# utf-8 is default
xmlheader
=
"<?xml version='1.0'?>
\n
"
# utf-8 is default
# standard XML-RPC wrappings
# standard XML-RPC wrappings
if
methodname
:
if
methodname
is
not
None
:
# a method call
# a method call
if
not
isinstance
(
methodname
,
StringType
):
if
not
isinstance
(
methodname
,
StringType
):
methodname
=
methodname
.
encode
(
encoding
)
methodname
=
methodname
.
encode
(
encoding
)
...
...
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