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
f4ef7e6a
Kaydet (Commit)
f4ef7e6a
authored
Haz 22, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
doctor the exception
üst
4cdcef7e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
newimp.py
Lib/newimp.py
+14
-7
No files found.
Lib/newimp.py
Dosyayı görüntüle @
f4ef7e6a
...
@@ -68,10 +68,10 @@ also denoted in the module by '__package__'. Additionally, modules have
...
@@ -68,10 +68,10 @@ also denoted in the module by '__package__'. Additionally, modules have
associated with them a '__pkgpath__', a path by which sibling modules are
associated with them a '__pkgpath__', a path by which sibling modules are
found."""
found."""
__version__
=
"Revision: 1.1
3
"
__version__
=
"Revision: 1.1
4
"
# Id: newimp.py,v 1.1
3 1995/04/13 23:23:33 klm Exp First release:
# Id: newimp.py,v 1.1
4 1995/05/10 19:15:07 klm Exp
# Ken.Manheimer@nist.gov, 5-Apr-1995, for python 1.2
#
First release:
Ken.Manheimer@nist.gov, 5-Apr-1995, for python 1.2
# Developers Notes:
# Developers Notes:
#
#
...
@@ -82,7 +82,7 @@ __version__ = "Revision: 1.13"
...
@@ -82,7 +82,7 @@ __version__ = "Revision: 1.13"
# - The test routines are cool, including a transient directory
# - The test routines are cool, including a transient directory
# hierarchy facility, and a means of skipping to later tests by giving
# hierarchy facility, and a means of skipping to later tests by giving
# the test routine a numeric arg.
# the test routine a numeric arg.
# - This could be substantially optimized, and there are
many
loose ends
# - This could be substantially optimized, and there are
some
loose ends
# lying around, since i wanted to get this released for 1.2.
# lying around, since i wanted to get this released for 1.2.
VERBOSE
=
0
VERBOSE
=
0
...
@@ -605,11 +605,18 @@ def compile_source(sourcePath, sourceFile):
...
@@ -605,11 +605,18 @@ def compile_source(sourcePath, sourceFile):
return
None
return
None
mtime
=
os
.
stat
(
sourcePath
)[
8
]
mtime
=
os
.
stat
(
sourcePath
)[
8
]
sourceFile
.
seek
(
0
)
# rewind
sourceFile
.
seek
(
0
)
# rewind
try
:
compiled
=
compile
(
sourceFile
.
read
(),
sourcePath
,
'exec'
)
except
SyntaxError
:
# Doctor the exception a bit, to include the source file name in the
# report, and then reraise the doctored version.
os
.
unlink
(
compiledFile
.
name
)
sys
.
exc_value
=
((
sys
.
exc_value
[
0
]
+
' in '
+
sourceFile
.
name
,)
+
sys
.
exc_value
[
1
:])
raise
sys
.
exc_type
,
sys
.
exc_value
try
:
try
:
compiledFile
.
write
(
imp
.
get_magic
())
# compiled magic number
compiledFile
.
write
(
imp
.
get_magic
())
# compiled magic number
compiledFile
.
seek
(
8
,
0
)
# mtime space holder
compiledFile
.
seek
(
8
,
0
)
# mtime space holder
# We let compilation errors go their own way...
compiled
=
compile
(
sourceFile
.
read
(),
sourcePath
,
'exec'
)
marshal
.
dump
(
compiled
,
compiledFile
)
# write the code obj
marshal
.
dump
(
compiled
,
compiledFile
)
# write the code obj
compiledFile
.
seek
(
4
,
0
)
# position for mtime
compiledFile
.
seek
(
4
,
0
)
# position for mtime
compiledFile
.
write
(
marshal
.
dumps
(
mtime
)[
1
:])
# register mtime
compiledFile
.
write
(
marshal
.
dumps
(
mtime
)[
1
:])
# register mtime
...
@@ -617,7 +624,7 @@ def compile_source(sourcePath, sourceFile):
...
@@ -617,7 +624,7 @@ def compile_source(sourcePath, sourceFile):
compiledFile
.
close
()
compiledFile
.
close
()
return
compiledPath
return
compiledPath
except
IOError
:
except
IOError
:
return
None
return
None
# ===>
def
PathExtension
(
locals
,
globals
):
# Probably obsolete.
def
PathExtension
(
locals
,
globals
):
# Probably obsolete.
...
...
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