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
5b787e8b
Kaydet (Commit)
5b787e8b
authored
Ock 13, 2007
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix pybench so it works -- Larry Hastings.
üst
16be03e4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
39 deletions
+41
-39
CommandLine.py
Tools/pybench/CommandLine.py
+11
-9
Dict.py
Tools/pybench/Dict.py
+2
-2
Exceptions.py
Tools/pybench/Exceptions.py
+3
-3
Lookups.py
Tools/pybench/Lookups.py
+25
-25
No files found.
Tools/pybench/CommandLine.py
Dosyayı görüntüle @
5b787e8b
...
@@ -165,7 +165,7 @@ class Option:
...
@@ -165,7 +165,7 @@ class Option:
def
__init__
(
self
,
name
,
help
=
None
):
def
__init__
(
self
,
name
,
help
=
None
):
if
not
name
[:
1
]
==
'-'
:
if
not
name
[:
1
]
==
'-'
:
raise
TypeError
,
'option names must start with "-"'
raise
TypeError
(
'option names must start with "-"'
)
if
name
[
1
:
2
]
==
'-'
:
if
name
[
1
:
2
]
==
'-'
:
self
.
prefix
=
'--'
self
.
prefix
=
'--'
self
.
name
=
name
[
2
:]
self
.
name
=
name
[
2
:]
...
@@ -324,30 +324,32 @@ class Application:
...
@@ -324,30 +324,32 @@ class Application:
# Append preset options
# Append preset options
for
option
in
self
.
preset_options
:
for
option
in
self
.
preset_options
:
if
not
self
.
option_map
.
has_key
(
option
.
name
)
:
if
not
option
.
name
in
self
.
option_map
:
self
.
add_option
(
option
)
self
.
add_option
(
option
)
# Init .files list
# Init .files list
self
.
files
=
[]
self
.
files
=
[]
# Start Application
# Start Application
rc
=
0
try
:
try
:
# Process startup
# Process startup
rc
=
self
.
startup
()
rc
=
self
.
startup
()
if
rc
is
not
None
:
if
rc
is
not
None
:
raise
SystemExit
,
rc
raise
SystemExit
(
rc
)
# Parse command line
# Parse command line
rc
=
self
.
parse
()
rc
=
self
.
parse
()
if
rc
is
not
None
:
if
rc
is
not
None
:
raise
SystemExit
,
rc
raise
SystemExit
(
rc
)
# Start application
# Start application
rc
=
self
.
main
()
rc
=
self
.
main
()
if
rc
is
None
:
if
rc
is
None
:
rc
=
0
rc
=
0
except
SystemExit
as
rc
:
except
SystemExit
as
rcException
:
rc
=
rcException
pass
pass
except
KeyboardInterrupt
:
except
KeyboardInterrupt
:
...
@@ -367,7 +369,7 @@ class Application:
...
@@ -367,7 +369,7 @@ class Application:
print
print
rc
=
1
rc
=
1
raise
SystemExit
,
rc
raise
SystemExit
(
rc
)
def
add_option
(
self
,
option
):
def
add_option
(
self
,
option
):
...
@@ -398,7 +400,7 @@ class Application:
...
@@ -398,7 +400,7 @@ class Application:
program. It defaults to 0 which usually means: OK.
program. It defaults to 0 which usually means: OK.
"""
"""
raise
SystemExit
,
rc
raise
SystemExit
(
rc
)
def
parse
(
self
):
def
parse
(
self
):
...
@@ -459,7 +461,7 @@ class Application:
...
@@ -459,7 +461,7 @@ class Application:
except
AttributeError
:
except
AttributeError
:
if
value
==
''
:
if
value
==
''
:
# count the number of occurances
# count the number of occurances
if
values
.
has_key
(
optionname
)
:
if
optionname
in
values
:
values
[
optionname
]
=
values
[
optionname
]
+
1
values
[
optionname
]
=
values
[
optionname
]
+
1
else
:
else
:
values
[
optionname
]
=
1
values
[
optionname
]
=
1
...
@@ -468,7 +470,7 @@ class Application:
...
@@ -468,7 +470,7 @@ class Application:
else
:
else
:
rc
=
handler
(
value
)
rc
=
handler
(
value
)
if
rc
is
not
None
:
if
rc
is
not
None
:
raise
SystemExit
,
rc
raise
SystemExit
(
rc
)
# Apply final file check (for backward compatibility)
# Apply final file check (for backward compatibility)
rc
=
self
.
check_files
(
self
.
files
)
rc
=
self
.
check_files
(
self
.
files
)
...
...
Tools/pybench/Dict.py
Dosyayı görüntüle @
5b787e8b
...
@@ -351,7 +351,7 @@ class SimpleDictManipulation(Test):
...
@@ -351,7 +351,7 @@ class SimpleDictManipulation(Test):
def
test
(
self
):
def
test
(
self
):
d
=
{}
d
=
{}
has_key
=
d
.
has_key
has_key
=
lambda
key
:
key
in
d
for
i
in
xrange
(
self
.
rounds
):
for
i
in
xrange
(
self
.
rounds
):
...
@@ -498,7 +498,7 @@ class SimpleDictManipulation(Test):
...
@@ -498,7 +498,7 @@ class SimpleDictManipulation(Test):
def
calibrate
(
self
):
def
calibrate
(
self
):
d
=
{}
d
=
{}
has_key
=
d
.
has_key
has_key
=
lambda
key
:
key
in
d
for
i
in
xrange
(
self
.
rounds
):
for
i
in
xrange
(
self
.
rounds
):
pass
pass
Tools/pybench/Exceptions.py
Dosyayı görüntüle @
5b787e8b
...
@@ -20,15 +20,15 @@ class TryRaiseExcept(Test):
...
@@ -20,15 +20,15 @@ class TryRaiseExcept(Test):
except
:
except
:
pass
pass
try
:
try
:
raise
error
,
"something"
raise
error
(
"something"
)
except
:
except
:
pass
pass
try
:
try
:
raise
error
,
"something"
raise
error
(
"something"
)
except
:
except
:
pass
pass
try
:
try
:
raise
error
,
"something"
raise
error
(
"something"
)
except
:
except
:
pass
pass
try
:
try
:
...
...
Tools/pybench/Lookups.py
Dosyayı görüntüle @
5b787e8b
...
@@ -774,11 +774,11 @@ class BuiltinMethodLookup(Test):
...
@@ -774,11 +774,11 @@ class BuiltinMethodLookup(Test):
l
.
sort
l
.
sort
l
.
sort
l
.
sort
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
items
d
.
items
d
.
items
d
.
items
...
@@ -810,11 +810,11 @@ class BuiltinMethodLookup(Test):
...
@@ -810,11 +810,11 @@ class BuiltinMethodLookup(Test):
l
.
sort
l
.
sort
l
.
sort
l
.
sort
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
items
d
.
items
d
.
items
d
.
items
...
@@ -846,11 +846,11 @@ class BuiltinMethodLookup(Test):
...
@@ -846,11 +846,11 @@ class BuiltinMethodLookup(Test):
l
.
sort
l
.
sort
l
.
sort
l
.
sort
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
items
d
.
items
d
.
items
d
.
items
...
@@ -882,11 +882,11 @@ class BuiltinMethodLookup(Test):
...
@@ -882,11 +882,11 @@ class BuiltinMethodLookup(Test):
l
.
sort
l
.
sort
l
.
sort
l
.
sort
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
items
d
.
items
d
.
items
d
.
items
...
@@ -918,11 +918,11 @@ class BuiltinMethodLookup(Test):
...
@@ -918,11 +918,11 @@ class BuiltinMethodLookup(Test):
l
.
sort
l
.
sort
l
.
sort
l
.
sort
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
has_key
#
d.has_key
d
.
items
d
.
items
d
.
items
d
.
items
...
...
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